mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 22:25:58 +08:00
fix: xinference-chat-stream-response (#991)
This commit is contained in:
parent
18d3877151
commit
bd3a9b2f8d
@ -123,7 +123,12 @@ class XinferenceLLM(Xinference):
|
|||||||
if choices:
|
if choices:
|
||||||
choice = choices[0]
|
choice = choices[0]
|
||||||
if isinstance(choice, dict):
|
if isinstance(choice, dict):
|
||||||
token = choice.get("text", "")
|
if 'text' in choice:
|
||||||
|
token = choice.get("text", "")
|
||||||
|
elif 'delta' in choice and 'content' in choice['delta']:
|
||||||
|
token = choice.get('delta').get('content')
|
||||||
|
else:
|
||||||
|
continue
|
||||||
log_probs = choice.get("logprobs")
|
log_probs = choice.get("logprobs")
|
||||||
if run_manager:
|
if run_manager:
|
||||||
run_manager.on_llm_new_token(
|
run_manager.on_llm_new_token(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user