Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openai 接口 v1.x 返回错误 'NoneType' object has no attribute 'items' #768

Closed
2 tasks done
menkeyi001 opened this issue Dec 8, 2023 · 2 comments
Closed
2 tasks done
Assignees

Comments

@menkeyi001
Copy link

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

No response

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

运行错误
File "/data/anaconda3/envs/LangChain/lib/python3.9/site-packages/langchain_core/language_models/chat_models.py", line 632, in call
generation = self.generate(
File "/data/anaconda3/envs/LangChain/lib/python3.9/site-packages/langchain_core/language_models/chat_models.py", line 383, in generate
llm_output = self._combine_llm_outputs([res.llm_output for res in results])
File "/data/anaconda3/envs/LangChain/lib/python3.9/site-packages/langchain/chat_models/openai.py", line 363, in _combine_llm_outputs
for k, v in token_usage.items():
AttributeError: 'NoneType' object has no attribute 'items'

现在token_usage返回值为None,测试openai v1.x 版本都不行需要0.28 能否更新一下接口呢

@jklj077
Copy link
Contributor

jklj077 commented Dec 11, 2023

目前确实不支持openai 1.0以上的版本呢,@JianxinMa 这个是不是可以说明下现在需要"openai<1.0"

@jklj077
Copy link
Contributor

jklj077 commented Dec 21, 2023

暂时在README中说明仅支持"openai<1.0.0",目前如需支持新版openai建议使用FastChat+vLLM,具体请参考README中的部署章节。

@jklj077 jklj077 closed this as completed Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants