Skip to content

Commit

Permalink
update accuracy embedding endpoint for no wrapper (opea-project#1056)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
lkk12014402 and pre-commit-ci[bot] authored Nov 4, 2024
1 parent 5eb3d28 commit 3372b9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ChatQnA/benchmark/accuracy/eval_multihop.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def get_reranked_documents(self, query, docs, arguments):
return []

def get_retrieved_documents(self, query, arguments):
data = {"text": query}
data = {"inputs": query}
headers = {"Content-Type": "application/json"}
response = requests.post(arguments.embedding_endpoint, data=json.dumps(data), headers=headers)
response = requests.post(arguments.tei_embedding_endpoint + "/embed", data=json.dumps(data), headers=headers)
if response.ok:
embedding = response.json()["embedding"]
embedding = response.json()[0]
else:
print(f"Request for embedding failed due to {response.text}.")
return []
Expand Down

0 comments on commit 3372b9d

Please sign in to comment.