Skip to content

Commit

Permalink
update embedding endpoint for no wrapper. (#187)
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 ccfd127 commit aef0cf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions evals/evaluation/rag_eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def post_process(self, result):

def get_retrieved_documents(self, data, arguments):
query = self.get_query(data)
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
6 changes: 3 additions & 3 deletions evals/evaluation/rag_eval/examples/eval_multihop.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,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 aef0cf5

Please sign in to comment.