Let ThreadPool exit gracefully. (#3653)

### What problem does this PR solve?

#3646

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-11-26 16:31:07 +08:00
committed by GitHub
parent 5c59651bda
commit 0891a393d7
5 changed files with 37 additions and 39 deletions

View File

@ -366,7 +366,7 @@ class OllamaChat(Base):
keep_alive=-1
)
ans = response["message"]["content"].strip()
return ans, response["eval_count"] + response.get("prompt_eval_count", 0)
return ans, response.get("eval_count", 0) + response.get("prompt_eval_count", 0)
except Exception as e:
return "**ERROR**: " + str(e), 0