mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: ollama model add error. (#5947)
### What problem does this PR solve? #5944 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -287,12 +287,6 @@ def chat_completion_openai_like(tenant_id, chat_id):
|
||||
answer = ans["answer"]
|
||||
incremental = answer[should_split_index:]
|
||||
token_used += len(incremental)
|
||||
|
||||
"""
|
||||
bugfix: When calling the Create chat completion API, the response data is incoherent.
|
||||
bug code: token_used += len(incremental)
|
||||
fix author: 任奇
|
||||
"""
|
||||
if incremental.endswith("</think>"):
|
||||
response_data_len = len(incremental.rstrip("</think>"))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user