Просмотр исходного кода

fix local variable ans (#3077)

### What problem does this PR solve?
#3064

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.13.0
Kevin Hu 1 год назад
Родитель
Сommit
7e0148c058
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 4 добавлений и 0 удалений
  1. 4
    0
      rag/llm/chat_model.py

+ 4
- 0
rag/llm/chat_model.py Просмотреть файл

@@ -109,6 +109,8 @@ class XinferenceChat(Base):
if base_url.split("/")[-1] != "v1":
base_url = os.path.join(base_url, "v1")
super().__init__(key, model_name, base_url)


class HuggingFaceChat(Base):
def __init__(self, key=None, model_name="", base_url=""):
if not base_url:
@@ -117,6 +119,7 @@ class HuggingFaceChat(Base):
base_url = os.path.join(base_url, "v1")
super().__init__(key, model_name, base_url)


class DeepSeekChat(Base):
def __init__(self, key, model_name="deepseek-chat", base_url="https://api.deepseek.com/v1"):
if not base_url: base_url = "https://api.deepseek.com/v1"
@@ -1247,6 +1250,7 @@ class AnthropicChat(Base):
if "max_tokens" not in gen_conf:
gen_conf["max_tokens"] = 4096

ans = ""
try:
response = self.client.messages.create(
model=self.model_name,

Загрузка…
Отмена
Сохранить