irlab-sdu / fuzi.mingcha

夫子•明察司法大模型是由山东大学、浪潮云、**政法大学联合研发,以 ChatGLM 为大模型底座,基于海量中文无监督司法语料与有监督司法微调数据训练的中文司法大模型。该模型支持法条检索、案例分析、三段论推理判决以及司法对话等功能,旨在为用户提供全方位、高精准的法律咨询与解答服务。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 7: illegal multibyte sequence

xiaolaoying opened this issue · comments

作者你好,我在启动Singularity镜像时遇到了以下的错误:
Traceback (most recent call last):
File "/mnt/task1/api.py", line 132, in
create_index()
File "/mnt/task1/api.py", line 65, in create_index
headers = next(reader)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 7: illegal multibyte sequence

似乎是使用gbk编码解析文件时遇到了错误。我将其改成了utf-8,可以运行。即把api.py line 63改成:
with open(path, "r", encoding="utf-8") as csvfile:

系统环境如下:
OS: Ubuntu 22.04.3 LTS
singularity-ce version 3.8.0

这是什么原因呀?

commented

感谢您报告此问题,问题的原因是文件的编码与系统默认的编码不匹配。使用 utf-8 是正确的,我们会修复这个问题。