InternVL
InternVL copied to clipboard
[Bug]
Checklist
- [x] 1. I have searched related issues but cannot get the expected help.
- [x] 2. The bug has not been fixed in the latest version.
- [x] 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
Describe the bug
一个明显的bug,InternVL/internvl_chat_gpt_oss/internvl/train/internvl_chat_finetune.py中
first_turn_idx = 1 if data_item['conversations'][0]['value'] == 'system' else 0 该语句的'value'应该改为'from'
Reproduction
当训练集的jsonl的conversations字段包含system的一项时,会错将image插入到systemprompt中,从而导致数据被废弃
Environment
pip
Error traceback
感觉的确是写错了,应该是检测 'from' 是否为 'system'。不过感觉这个 typo 没有影响,这行有 typo 的代码目的是定位 user,并在后面一行代码给 user value 中插入个
first_turn_idx = 1 if data_item['conversations'][0]['value'] == 'system' else 0
if '<image>' not in data_item['conversations'][first_turn_idx]['value']:
data_item['conversations'][first_turn_idx]['value'] = '<image>\n' + data_item['conversations'][first_turn_idx]['value']
因为训 internvl2.5/3/3.5 按官方脚本一般是通过指定 conv_style 即 template_name 来在代码内确定代码中固定的 system message,因此数据中的第一个 from 一般是 user,可以认为是 first_turn_idx = 0 一直成立,即上面带 typo 的代码执行其实对得齐使用场景?