Support Xinference (#321)

### What problem does this PR solve?

Issue link:#299

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
KevinHuSh
2024-04-11 18:25:37 +08:00
committed by GitHub
parent 91068edf16
commit 8ffc09cb5c
2 changed files with 45 additions and 1 deletions

View File

@ -161,9 +161,10 @@ class OllamaCV(Base):
except Exception as e:
return "**ERROR**: " + str(e), 0
class XinferenceCV(Base):
def __init__(self, key, model_name="", lang="Chinese", base_url=""):
self.client = OpenAI(api_key=key, base_url=base_url)
self.client = OpenAI(api_key="xxx", base_url=base_url)
self.model_name = model_name
self.lang = lang