Fix error response (#3719)

### What problem does this PR solve?



### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Kevin Hu
2024-11-28 18:56:10 +08:00
committed by GitHub
parent 4e8e4fe53f
commit 91f1814a87
3 changed files with 7 additions and 1 deletions

View File

@ -158,6 +158,8 @@ class XInferenceRerank(Base):
def __init__(self, key="xxxxxxx", model_name="", base_url=""):
if base_url.find("/v1") == -1:
base_url = urljoin(base_url, "/v1/rerank")
if base_url.find("/rerank") == -1:
base_url = urljoin(base_url, "/v1/rerank")
self.model_name = model_name
self.base_url = base_url
self.headers = {