From 3e4be8032a9a04dd6441a891710e930a17d18261 Mon Sep 17 00:00:00 2001 From: Xinyao Wang Date: Wed, 13 Nov 2024 14:52:36 +0800 Subject: [PATCH] fix bug Signed-off-by: Xinyao Wang --- comps/embeddings/multimodal_clip/embedding_multimodal.py | 2 +- comps/embeddings/predictionguard/embedding_predictionguard.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/comps/embeddings/multimodal_clip/embedding_multimodal.py b/comps/embeddings/multimodal_clip/embedding_multimodal.py index a9fa88e5c..2401326a0 100644 --- a/comps/embeddings/multimodal_clip/embedding_multimodal.py +++ b/comps/embeddings/multimodal_clip/embedding_multimodal.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import datetime -import time +import time,os from typing import List, Optional, Union from dateparser.search import search_dates from embeddings_clip import vCLIP diff --git a/comps/embeddings/predictionguard/embedding_predictionguard.py b/comps/embeddings/predictionguard/embedding_predictionguard.py index 793f35d2d..f5274e3b5 100644 --- a/comps/embeddings/predictionguard/embedding_predictionguard.py +++ b/comps/embeddings/predictionguard/embedding_predictionguard.py @@ -76,6 +76,7 @@ async def embedding( async def get_embeddings(text: Union[str, List[str]]) -> List[List[float]]: texts = [text] if isinstance(text, str) else text + texts = [{"text": texts[i]} for i in range(len(texts))] response = client.embeddings.create(model=pg_embedding_model_name, input=texts)["data"] embed_vector = [response[i]["embedding"] for i in range(len(response))] return embed_vector