Skip to content

Commit 11b86cf

Browse files
authored
Merge pull request #570 from valentimarco/develop
Fix Fastembed bug
2 parents bb44da4 + c5c9356 commit 11b86cf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/cat/factory/custom_embedder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@ def __init__(self, url, model,max_length) -> None:
7575

7676

7777
def embed_documents(self, texts: List[str]):
78-
payload = json.dumps({"document": texts})
79-
ret = httpx.post(f"{self.url}/embeddings/document", data=payload, timeout=None)
78+
ret = httpx.post(f"{self.url}/embeddings/document", json={"document": texts}, timeout=None)
8079
ret.raise_for_status()
8180
return ret.json()
8281

8382
def embed_query(self, text: str) -> List[float]:
84-
payload = json.dumps({"prompt": text})
85-
ret = httpx.post(f"{self.url}/embeddings/prompt", data=payload, timeout=None)
83+
ret = httpx.post(f"{self.url}/embeddings/prompt", json={"prompt": text}, timeout=None)
8684
ret.raise_for_status()
8785
return ret.json()
8886

0 commit comments

Comments
 (0)