ソースを参照

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年前
コミット
7e0148c058
コミッターのメールアドレスに関連付けられたアカウントが存在しません
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,

読み込み中…
キャンセル
保存