We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18d3877 commit bd3a9b2Copy full SHA for bd3a9b2
api/core/third_party/langchain/llms/xinference_llm.py
@@ -123,7 +123,12 @@ def _stream_generate(
123
if choices:
124
choice = choices[0]
125
if isinstance(choice, dict):
126
- token = choice.get("text", "")
+ if 'text' in choice:
127
+ token = choice.get("text", "")
128
+ elif 'delta' in choice and 'content' in choice['delta']:
129
+ token = choice.get('delta').get('content')
130
+ else:
131
+ continue
132
log_probs = choice.get("logprobs")
133
if run_manager:
134
run_manager.on_llm_new_token(
0 commit comments