Kaynağa Gözat

Fix: api-key issue for xinference. (#6490)

### What problem does this PR solve?

#2792

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
Kevin Hu 7 ay önce
ebeveyn
işleme
60c3a253ad
No account linked to committer's email address
1 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 4
    3
      rag/llm/rerank_model.py

+ 4
- 3
rag/llm/rerank_model.py Dosyayı Görüntüle

@@ -208,7 +208,7 @@ class YoudaoRerank(DefaultRerank):


class XInferenceRerank(Base):
def __init__(self, key="xxxxxxx", model_name="", base_url=""):
def __init__(self, key="x", model_name="", base_url=""):
if base_url.find("/v1") == -1:
base_url = urljoin(base_url, "/v1/rerank")
if base_url.find("/rerank") == -1:
@@ -217,9 +217,10 @@ class XInferenceRerank(Base):
self.base_url = base_url
self.headers = {
"Content-Type": "application/json",
"accept": "application/json",
"Authorization": f"Bearer {key}"
"accept": "application/json"
}
if key and key != "x":
self.headers["Authorization"] = f"Bearer {key}"

def similarity(self, query: str, texts: list):
if len(texts) == 0:

Loading…
İptal
Kaydet