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

本地方式启动解码报错 #41

Open
Fang-Joker opened this issue Oct 30, 2023 · 3 comments
Open

本地方式启动解码报错 #41

Fang-Joker opened this issue Oct 30, 2023 · 3 comments

Comments

@Fang-Joker
Copy link

本地启动python main.py,报下面的gbk解码错误,请问这个是为什么?
检查了下系统是utf-8的编码方式的
(venv) PS D:\Tools\PyCharm 2023.2\project\Data-Copilot-main> python main.py
None
None
===============================Intent Detecting===========================================
Traceback (most recent call last):
File "D:\Tools\PyCharm 2023.2\project\Data-Copilot-main\main.py", line 382, in
output, image, df , output_result = run(instruction, send_chat_request_Azure = openai_call, openai_key=openai_key, api_base='', engine='')
File "D:\Tools\PyCharm 2023.2\project\Data-Copilot-main\main.py", line 128, in run
prompt_task_dict = json.load(f)
File "D:\refer-self\study-self\python\lib\json_init_.py", line 293, in load
return loads(fp.read(),

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa5 in position 46: illegal multibyte sequence

@zwq2018
Copy link
Owner

zwq2018 commented Oct 30, 2023

with open(filename, 'r', encoding='utf-8') as f:
prompt_task_dict = json.load(f)

你明确指定下编码方法试试吧 ,很容易debug

@Fang-Joker
Copy link
Author

多谢,已解决
这边还有个问题。pro设置如下
openai_call = send_official_call
也购买了一个临时的openai的key
但是在main的Step-1:Task selec这个阶段的
response = send_chat_request_Azure(prompt_intent_detection, openai_key=openai_key, api_base=api_base, engine=engine)
一直报超时失败,我看lan_gpt4_call.py中send_official_call中确实是调用openai的请求,这种是因为key的问题导致的吗?我看我这边是能正常访问openai的官网的

@zwq2018
Copy link
Owner

zwq2018 commented Nov 1, 2023

我用的是微软云的openai,你要用openai官网的api稍微改下接口就可以

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