瀏覽代碼

feat: optimize xinference stream (#989)

tags/0.3.17
takatost 2 年之前
父節點
當前提交
18d3877151
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      api/core/third_party/langchain/llms/xinference_llm.py

+ 3
- 3
api/core/third_party/langchain/llms/xinference_llm.py 查看文件

@@ -108,12 +108,12 @@ class XinferenceLLM(Xinference):
Yields:
A string token.
"""
if isinstance(model, RESTfulGenerateModelHandle):
streaming_response = model.generate(
if isinstance(model, (RESTfulChatModelHandle, RESTfulChatglmCppChatModelHandle)):
streaming_response = model.chat(
prompt=prompt, generate_config=generate_config
)
else:
streaming_response = model.chat(
streaming_response = model.generate(
prompt=prompt, generate_config=generate_config
)


Loading…
取消
儲存