Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: Xinyao Wang <[email protected]>
  • Loading branch information
XinyaoWa committed Nov 13, 2024
1 parent 76a3807 commit 3e4be80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion comps/embeddings/multimodal_clip/embedding_multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e4be80

Please sign in to comment.