mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-16 15:55:57 +08:00
lower openai version in requirements.txt (#1747)
### What problem does this PR solve? lower openai version in requirements.txt ### Type of change - [x] Refactoring Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
This commit is contained in:
parent
ceb0419fe5
commit
5cff780ec4
@ -180,13 +180,18 @@ class BaiChuanChat(Base):
|
||||
stream=True,
|
||||
**self._format_params(gen_conf))
|
||||
for resp in response:
|
||||
if resp.choices[0].finish_reason == "stop":
|
||||
if not resp.choices[0].delta.content:
|
||||
continue
|
||||
total_tokens = resp.usage.total_tokens
|
||||
if not resp.choices:continue
|
||||
if not resp.choices[0].delta.content:
|
||||
continue
|
||||
resp.choices[0].delta.content = ""
|
||||
ans += resp.choices[0].delta.content
|
||||
total_tokens = (
|
||||
(
|
||||
total_tokens
|
||||
+ num_tokens_from_string(resp.choices[0].delta.content)
|
||||
)
|
||||
if not hasattr(resp, "usage")
|
||||
else resp.usage["total_tokens"]
|
||||
)
|
||||
if resp.choices[0].finish_reason == "length":
|
||||
ans += "...\nFor the content length reason, it stopped, continue?" if is_english(
|
||||
[ans]) else "······\n由于长度的原因,回答被截断了,要继续吗?"
|
||||
|
@ -39,7 +39,7 @@ numpy==1.26.4
|
||||
ollama==0.2.1
|
||||
onnxruntime==1.17.3
|
||||
onnxruntime_gpu==1.17.1
|
||||
openai==1.35.14
|
||||
openai==1.12.0
|
||||
opencv_python==4.9.0.80
|
||||
opencv_python_headless==4.9.0.80
|
||||
openpyxl==3.1.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user