Skip to content

Commit 5e4b9f7

Browse files
committed
fix: reranker prefix
1 parent 28b97cd commit 5e4b9f7

File tree

1 file changed

+2
-1
lines changed
  • apps/models_provider/impl/local_model_provider/model

1 file changed

+2
-1
lines changed

apps/models_provider/impl/local_model_provider/model/reranker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def compress_documents(self, documents: Sequence[Document], query: str, callback
5252
Sequence[Document]:
5353
if documents is None or len(documents) == 0:
5454
return []
55+
prefix = CONFIG.get_admin_path()
5556
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
5657
res = requests.post(
57-
f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/api/model/{self.model_id}/compress_documents',
58+
f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}{prefix}/api/model/{self.model_id}/compress_documents',
5859
json={'documents': [{'page_content': document.page_content, 'metadata': document.metadata} for document in
5960
documents], 'query': query}, headers={'Content-Type': 'application/json'})
6061
result = res.json()

0 commit comments

Comments
 (0)