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

UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 93: illegal multibyte sequence #90

Open
cookie925 opened this issue Aug 11, 2023 · 2 comments

Comments

@cookie925
Copy link

Traceback (most recent call last):
File "E:\wbjdata\QA\Huatuo-Llama-Med-Chinese-main\Huatuo-Llama-Med-Chinese-main\1.py", line 124, in
fire.Fire(main)
File "E:\anaconda3\envs\LLAMA10\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "E:\anaconda3\envs\LLAMA10\lib\site-packages\fire\core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "E:\anaconda3\envs\LLAMA10\lib\site-packages\fire\core.py", line 691, in CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "E:\wbjdata\QA\Huatuo-Llama-Med-Chinese-main\Huatuo-Llama-Med-Chinese-main\1.py", line 36, in main
prompter = Prompter(prompt_template)
File "E:\wbjdata\QA\Huatuo-Llama-Med-Chinese-main\Huatuo-Llama-Med-Chinese-main\utils\prompter.py", line 22, in init
self.template = json.load(fp)
File "E:\anaconda3\envs\LLAMA10\lib\json_init
.py", line 293, in load
return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 93: illegal multibyte sequence
请问大家为什么会出现这种情况啊,是哪个文件出错了呢

@s65b40
Copy link
Collaborator

s65b40 commented Aug 12, 2023

你好,大概率是读template的时候的编码问题,请pull仓库最新的版本并尝试,刚刚添加了utf-8编码

@cookie925
Copy link
Author

你好,大概率是读template的时候的编码问题,请pull仓库最新的版本并尝试,刚刚添加了utf-8编码

谢谢,我等下试试。
我前天把prompter.py 文件21行的代码with open(file_name) as fp: 改成了 with open(file_name,encoding=‘utf-8’) 它意外的跑起来了,不过就是回答的时候有些特殊符号。

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