GPT2-chitchat icon indicating copy to clipboard operation
GPT2-chitchat copied to clipboard

读取train.txt的时候报错,说utf8无法解码

Open MozarTuring opened this issue 4 years ago • 4 comments

MozarTuring avatar Sep 17 '20 06:09 MozarTuring

大家没碰到这个问题吗

MozarTuring avatar Sep 17 '20 06:09 MozarTuring

大家没碰到这个问题吗

是不是出現 cpXXX 之類的訊息? 我之前也有類似的問題,當時在 conda 環境下,我用 python 指令直接下,會有問題,但直接用 python3.7 這個原生指令,竟然就可以了。

telunyang avatar Sep 25 '20 06:09 telunyang

大家没碰到这个问题吗

Traceback (most recent call last): File "interact.py", line 177, in main() File "interact.py", line 135, in main text = input("user:") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 3: invalid continuation byte

GaloisGroGauss avatar Jan 21 '21 08:01 GaloisGroGauss

因为你的train.txt 是GBK编码 。要换成UTF-8

cywjava avatar Feb 28 '23 09:02 cywjava