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