diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index a652972a2..9a2eec5d5 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -56,6 +56,7 @@ class Base(ABC): stream=True, **gen_conf) for resp in response: + if len(resp.choices) == 0:continue if not resp.choices[0].delta.content:continue ans += resp.choices[0].delta.content total_tokens += 1