utf-8 - JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0) ---While Tuning gpt2.finetune
问题描述
希望你们都做得很好,我正在微调 GPT 2 模型以根据内容生成标题,在处理它时,我创建了一个简单的 CSV 文件,其中只包含标题来训练模型,但是在输入这个模型时到 GPT 2 进行微调我在 () 10 steps=1000, 11 save_every=200, ---> 12 sample_every=25) 中收到以下 ERROR , JSONDecodeError Traceback (last recent call last) #steps is max number of training步骤 13 14 # gpt2.generate(sess)
3 frames
/usr/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
336 if s.startswith('\ufeff'):
337 s = s.encode('utf8')[3:].decode('utf8')
--> 338 # raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
339 # s, 0)
340 else:
JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
Below is my code for the above :
import gpt_2_simple as gpt2
model_name = "120M" # "355M" for larger model (it's 1.4 GB)
gpt2.download_gpt2(model_name=model_name) # model is saved into current directory under /models/117M/
sess = gpt2.start_tf_sess()
gpt2.finetune(sess,
'titles.csv',
model_name=model_name,
steps=1000,
save_every=200,
sample_every=25) # steps is max number of training steps
I have tried all the basic mechanism of handing UTF -8 BOM but did not find any luck ,Hence requesting your help .It would be a great help from you all .
解决方案
尝试更改型号名称,因为我看到您输入 120M,而 gpt2 型号称为 124M
推荐阅读
- sql - 数据库关系如何在数据库中工作
- ssl - Heroku Godaddy 裸域 SSL HTTPS
- html - 使用 flexbox 将元素引导到底部
- c# - 当我想用 C# 合并两个大的 tiff 图像时为什么会出错?
- java - Java Spring Boot 安全类配置
- javascript - 隐藏的侧边菜单和 HTML5 颜色冲突
- c - 打印无效的 C 字符串成功
- python - 如何根据另一列中的值在数据框中设置零和一
- python - 防止将数字添加到数组槽或上限值的大多数 Pythonic 方法,如果添加会将数字超出其数据类型范围
- elasticsearch - 在 Elasticsearch 中的 TEXT 字段的情况下,有什么方法可以进行精确匹配?