Browse Source

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)
tags/v0.13.0
Sky Blue 1 year ago
parent
commit
2df15742fc
No account linked to committer's email address
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      rag/llm/rerank_model.py

+ 4
- 2
rag/llm/rerank_model.py View File

@@ -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…
Cancel
Save