mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 04:15:53 +08:00
fix xinference add rerank model bug (#2758)
### What problem does this PR solve? Fix xinference add rerank model bug, https://github.com/infiniflow/ragflow/issues/2294#issue-2510788135 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
8f815a6c1e
commit
2df15742fc
@ -15,6 +15,8 @@
|
||||
#
|
||||
import re
|
||||
import threading
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import requests
|
||||
from huggingface_hub import snapshot_download
|
||||
import os
|
||||
@ -154,8 +156,8 @@ class YoudaoRerank(DefaultRerank):
|
||||
|
||||
class XInferenceRerank(Base):
|
||||
def __init__(self, key="xxxxxxx", model_name="", base_url=""):
|
||||
if base_url.split("/")[-1] != "v1":
|
||||
base_url = os.path.join(base_url, "v1")
|
||||
if base_url.find("/v1") == -1:
|
||||
base_url = urljoin(base_url, "/v1/rerank")
|
||||
self.model_name = model_name
|
||||
self.base_url = base_url
|
||||
self.headers = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user