Skip to content

Commit

Permalink
[Bug]: unnecessary auto-increment calculations in the tokens statisti…
Browse files Browse the repository at this point in the history
…cs of the chat model (#2969)

### What problem does this PR solve?

the details is shown in
#2968

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Kevin Hu <[email protected]>
  • Loading branch information
yqwang96 and KevinHuSh authored Oct 22, 2024
1 parent 1fce6ca commit 445dce4
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion rag/llm/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def chat_streamly(self, system, history, gen_conf):
resp.choices[0].delta.content = ""
ans += resp.choices[0].delta.content

total_tokens += 1
if not hasattr(resp, "usage") or not resp.usage:
total_tokens = (
total_tokens
Expand Down

0 comments on commit 445dce4

Please sign in to comment.