瀏覽代碼

fix bedrock issue (#2776)

### What problem does this PR solve?

#2722

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.13.0
Kevin Hu 1 年之前
父節點
當前提交
29f022c91c
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      rag/llm/chat_model.py

+ 2
- 2
rag/llm/chat_model.py 查看文件

@@ -661,7 +661,7 @@ class BedrockChat(Base):
modelId=self.model_name,
messages=history,
inferenceConfig=gen_conf,
system=[{"text": system}] if system else None,
system=[{"text": (system if system else "Answer the user's message.")}]
)
ans = response["output"]["message"]["content"][0]["text"]
return ans, num_tokens_from_string(ans)
@@ -676,7 +676,7 @@ class BedrockChat(Base):
modelId=self.model_name,
messages=history,
inferenceConfig=gen_conf,
system=[{"text": system if system else ""}],
system=[{"text": (system if system else "Answer the user's message.")}]
)

# Extract and print the streamed response text in real-time.

Loading…
取消
儲存