Quellcode durchsuchen

[Bug]: unnecessary auto-increment calculations in the tokens statistics of the chat model (#2969)

### What problem does this PR solve?

the details is shown in
https://github.com/infiniflow/ragflow/issues/2968

### Type of change

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

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
tags/v0.13.0
Yinquan WANG vor 1 Jahr
Ursprung
Commit
445dce4363
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 0 neuen und 1 gelöschten Zeilen
  1. 0
    1
      rag/llm/chat_model.py

+ 0
- 1
rag/llm/chat_model.py Datei anzeigen

@@ -68,7 +68,6 @@ class Base(ABC):
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

Laden…
Abbrechen
Speichern