Kevin Hu
commited on
Commit
·
e9cc5fb
1
Parent(s):
5381c23
fix local variable ans (#3077)
Browse files### What problem does this PR solve?
#3064
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- rag/llm/chat_model.py +4 -0
rag/llm/chat_model.py
CHANGED
|
@@ -109,6 +109,8 @@ class XinferenceChat(Base):
|
|
| 109 |
if base_url.split("/")[-1] != "v1":
|
| 110 |
base_url = os.path.join(base_url, "v1")
|
| 111 |
super().__init__(key, model_name, base_url)
|
|
|
|
|
|
|
| 112 |
class HuggingFaceChat(Base):
|
| 113 |
def __init__(self, key=None, model_name="", base_url=""):
|
| 114 |
if not base_url:
|
|
@@ -117,6 +119,7 @@ class HuggingFaceChat(Base):
|
|
| 117 |
base_url = os.path.join(base_url, "v1")
|
| 118 |
super().__init__(key, model_name, base_url)
|
| 119 |
|
|
|
|
| 120 |
class DeepSeekChat(Base):
|
| 121 |
def __init__(self, key, model_name="deepseek-chat", base_url="https://api.deepseek.com/v1"):
|
| 122 |
if not base_url: base_url = "https://api.deepseek.com/v1"
|
|
@@ -1247,6 +1250,7 @@ class AnthropicChat(Base):
|
|
| 1247 |
if "max_tokens" not in gen_conf:
|
| 1248 |
gen_conf["max_tokens"] = 4096
|
| 1249 |
|
|
|
|
| 1250 |
try:
|
| 1251 |
response = self.client.messages.create(
|
| 1252 |
model=self.model_name,
|
|
|
|
| 109 |
if base_url.split("/")[-1] != "v1":
|
| 110 |
base_url = os.path.join(base_url, "v1")
|
| 111 |
super().__init__(key, model_name, base_url)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
class HuggingFaceChat(Base):
|
| 115 |
def __init__(self, key=None, model_name="", base_url=""):
|
| 116 |
if not base_url:
|
|
|
|
| 119 |
base_url = os.path.join(base_url, "v1")
|
| 120 |
super().__init__(key, model_name, base_url)
|
| 121 |
|
| 122 |
+
|
| 123 |
class DeepSeekChat(Base):
|
| 124 |
def __init__(self, key, model_name="deepseek-chat", base_url="https://api.deepseek.com/v1"):
|
| 125 |
if not base_url: base_url = "https://api.deepseek.com/v1"
|
|
|
|
| 1250 |
if "max_tokens" not in gen_conf:
|
| 1251 |
gen_conf["max_tokens"] = 4096
|
| 1252 |
|
| 1253 |
+
ans = ""
|
| 1254 |
try:
|
| 1255 |
response = self.client.messages.create(
|
| 1256 |
model=self.model_name,
|