refine log format (#312)

### What problem does this PR solve?

Issue link:#264
### Type of change


- [x] Documentation Update
- [x] Refactoring
This commit is contained in:
KevinHuSh
2024-04-11 10:13:43 +08:00
committed by GitHub
parent 0b2808f990
commit f6c7204002
9 changed files with 15 additions and 18 deletions

View File

@ -98,7 +98,7 @@ class QWenChat(Base):
tk_count = 0
if response.status_code == HTTPStatus.OK:
ans += response.output.choices[0]['message']['content']
tk_count += response.usage.output_tokens
tk_count += response.usage.total_tokens
if response.output.choices[0].get("finish_reason", "") == "length":
ans += "...\nFor the content length reason, it stopped, continue?" if is_english(
[ans]) else "······\n由于长度的原因,回答被截断了,要继续吗?"