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

[BUG] 重置会话后报错:cannot access local variable 'completion_text' where it is not associated with a value #1053

Closed
1 task done
zhuddd opened this issue Jul 14, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@zhuddd
Copy link

zhuddd commented Jul 14, 2023

提交 issue 前,请先确认:

  • 我已看过 FAQ,此问题不在列表中
  • [o] 我已看过其他 issue,他们不能解决我的问题
  • [o] 我认为这不是 Mirai 或者 OpenAI 的 BUG

表现
重置会话后报错:cannot access local variable 'completion_text' where it is not associated with a value

运行环境:

  • 操作系统:image
  • Docker: Docker version 24.0.2, build cb74dfc
  • 项目版本:image

复现步骤
描述你是如何触发这个 BUG 的

  1. 正常发送消息,机器人正常回答

  2. 发送重置会话,
    image

  3. 正常发送消息,出现报错
    image

  4. See error

预期行为
正常正常回复

截图
相关日志、聊天记录的截图,没有可跳过

其他内容
该bug针对单个用户发送“重置会话”后出现,即用户a触发bug后,用户b或群聊不受影响

@zhuddd zhuddd added the bug Something isn't working label Jul 14, 2023
@nonotouchtouch
Copy link

我也出现了这个问题,但是并没有重置会话,周四用的好的,今天用不了了。报错相同。

@Haibersut
Copy link
Collaborator

你看你api请求用的None模型,选一个正常的

@zhuddd
Copy link
Author

zhuddd commented Jul 16, 2023

你看你api请求用的None模型,选一个正常的

none模型是在重置会话后自动切过去的,手动切回3.5模型后依然会报这个错误

@Haibersut
Copy link
Collaborator

你看你api请求用的None模型,选一个正常的

none模型是在重置会话后自动切过去的,手动切回3.5模型后依然会报这个错误

你拉一下最新的docker看看,我这里是复现不出来
image

@zhuddd
Copy link
Author

zhuddd commented Jul 16, 2023

你看你api请求用的None模型,选一个正常的

none模型是在重置会话后自动切过去的,手动切回3.5模型后依然会报这个错误

你拉一下最新的docker看看,我这里是复现不出来 image
重新部署机器人后依然有问题,都是使用的GO-CQHTTP 版。我是使用win版登录qq后,获取session.token后复制到服务器登录的,
image

@zhuddd
Copy link
Author

zhuddd commented Jul 16, 2023

测试1
new ducument

image

@zhuddd
Copy link
Author

zhuddd commented Jul 16, 2023

测试2
new ducument
image

@zhuddd
Copy link
Author

zhuddd commented Jul 16, 2023

目前的情况是在重置会话之后:立马切换模型就不会报错,如果重置会话和切换模型之间有其他对话就会报错 @Haibersut

@Haibersut
Copy link
Collaborator

了解了,你可以试试在config中的openai.accounts加上model的参数

[openai]
api_endpoint = "xxxx"

[[openai.accounts]]
# # 你的 API key,可以在这里看: https://platform.openai.com/account/api-keys
api_key="xxxx"
model="gpt-3.5-turbo"

虽说我还是建议你检查一下docker镜像,我确实是无法复现你的情况(
image

@zhuddd
Copy link
Author

zhuddd commented Jul 17, 2023

了解了,你可以试试在config中的openai.accounts加上model的参数

[openai]
api_endpoint = "xxxx"

[[openai.accounts]]
# # 你的 API key,可以在这里看: https://platform.openai.com/account/api-keys
api_key="xxxx"
model="gpt-3.5-turbo"

虽说我还是建议你检查一下docker镜像,我确实是无法复现你的情况( image

加上model的参数后暂时不会报错了,感谢帮助

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants