fix: reranker prefix (#3605)
This commit is contained in:
parent
8e5ff3b1f4
commit
a67b39c87e
@ -52,9 +52,10 @@ class WebLocalBaseReranker(MaxKBBaseModel, BaseDocumentCompressor):
|
|||||||
Sequence[Document]:
|
Sequence[Document]:
|
||||||
if documents is None or len(documents) == 0:
|
if documents is None or len(documents) == 0:
|
||||||
return []
|
return []
|
||||||
|
prefix = CONFIG.get_admin_path()
|
||||||
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
|
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
|
||||||
res = requests.post(
|
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
|
json={'documents': [{'page_content': document.page_content, 'metadata': document.metadata} for document in
|
||||||
documents], 'query': query}, headers={'Content-Type': 'application/json'})
|
documents], 'query': query}, headers={'Content-Type': 'application/json'})
|
||||||
result = res.json()
|
result = res.json()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user