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

运行(nohup python3 app.py & tail -f nohup.out)报错,在线等大神帮忙解决 #1879

Open
2 tasks done
ansonken opened this issue Apr 7, 2024 · 1 comment
Open
2 tasks done

Comments

@ansonken
Copy link

ansonken commented Apr 7, 2024

前置确认

  • 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

Linux

运行的python版本是?

python 3.10

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wechatmp(公众号, 订阅号)

复现步骤 🕹

No response

问题描述 😯

使用场景:将文心一言接入到微信公众号(类型为订阅号)
运行报错:
root@iZ7xv8mfg9sqltrk77x0ofZ:~/chatgpt-on-wechat# nohup python3 app.py & tail -f nohup.out
[1] 26722
load_config()
File "/root/chatgpt-on-wechat/config.py", line 234, in load_config
config = Config(json.loads(config_str))
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 75 (char 76)
nohup: ignoring input and appending output to 'nohup.out'
[ERROR][2024-04-07 12:07:22][app.py:66] - App startup failed!
[ERROR][2024-04-07 12:07:22][app.py:67] - Invalid control character at: line 16 column 150 (char 593)
Traceback (most recent call last):
File "/root/chatgpt-on-wechat/app.py", line 46, in run
load_config()
File "/root/chatgpt-on-wechat/config.py", line 234, in load_config
config = Config(json.loads(config_str))
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 16 column 150 (char 593)
^C
[1]+ Done nohup python3 app.py

config.json文件配置:
{
"channel_type": "wechatmp",
"model": "wenxin",
"single_chat_prefix": [
"bot",
"@bot"
],
"single_chat_reply_prefix": "[bot] ",
"speech_recognition": true,
"group_speech_recognition": false,
"voice_reply_voice": false,
"conversation_max_tokens": 2500,
"expires_in_seconds": 3600,
"character_desc": "你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。",
"temperature": 0.7,
"subscribe_msg": "感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指[>
"use_linkai": false,
"linkai_api_key": "",
"linkai_app_code": ""
"baidu_wenxin_model": "eb-instant", # 默认使用ERNIE-Bot-turbo模型
"baidu_wenxin_api_key": "Mca3Im5q9DVql82vtqzZX2XX", # Baidu api key
"baidu_wenxin_secret_key": "GDAe5aHTy4xn9Pu2ErW3YyumG1OI6PXY", # Baidu secret key
"wechatmp_app_id": "wx16a392eceke1d58f",
"wechatmp_app_secret": "0cbb68c5ff52ae8e8c66259fc5923174",
"wechatmp_aes_key": "cfILCN",
"wechatmp_token": "ewvDOvDfILCN3BSo6HVrG0CTkB327ZtYmCQ2pJGWJlL",
"wechatmp_port": 80,
}

终端日志 📒

root@iZ7xv8mfg9sqltrk77x0ofZ:~/chatgpt-on-wechat# nohup python3 app.py & tail -f nohup.out
[1] 26722
    load_config()
  File "/root/chatgpt-on-wechat/config.py", line 234, in load_config
    config = Config(json.loads(config_str))
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 75 (char 76)
nohup: ignoring input and appending output to 'nohup.out'
[ERROR][2024-04-07 12:07:22][app.py:66] - App startup failed!
[ERROR][2024-04-07 12:07:22][app.py:67] - Invalid control character at: line 16 column 150 (char 593)
Traceback (most recent call last):
  File "/root/chatgpt-on-wechat/app.py", line 46, in run
    load_config()
  File "/root/chatgpt-on-wechat/config.py", line 234, in load_config
    config = Config(json.loads(config_str))
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 16 column 150 (char 593)
^C
[1]+  Done                    nohup python3 app.py

@ansonken
Copy link
Author

ansonken commented Apr 7, 2024

已解决,经过排查还是复制微信公众号相关配置到config.json语法的问题,配置给有需要的人
config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant