mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: reranker prefix (#3605)
This commit is contained in:
parent
8e5ff3b1f4
commit
a67b39c87e
|
|
@ -52,9 +52,10 @@ class WebLocalBaseReranker(MaxKBBaseModel, BaseDocumentCompressor):
|
|||
Sequence[Document]:
|
||||
if documents is None or len(documents) == 0:
|
||||
return []
|
||||
prefix = CONFIG.get_admin_path()
|
||||
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
|
||||
res = requests.post(
|
||||
f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/api/model/{self.model_id}/compress_documents',
|
||||
f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}{prefix}/api/model/{self.model_id}/compress_documents',
|
||||
json={'documents': [{'page_content': document.page_content, 'metadata': document.metadata} for document in
|
||||
documents], 'query': query}, headers={'Content-Type': 'application/json'})
|
||||
result = res.json()
|
||||
|
|
|
|||
Loading…
Reference in New Issue