modelscope / swift

ms-swift: Use PEFT or Full-parameter to finetune 250+ LLMs or 35+ MLLMs. (Qwen2, GLM4, Internlm2, Yi, Llama3, Llava, MiniCPM-V, Deepseek, Baichuan2, Gemma2, Phi3-Vision, ...)
https://github.com/modelscope/swift/blob/main/docs/source/LLM/index.md
Apache License 2.0
2.13k stars 205 forks source link

Intern-VL多图任务微调以及推理方式 #1235

Closed fourierer closed 2 days ago

fourierer commented 3 days ago

您好,我在intern-vl下看到您关于多图微调任务的描述,即按照逗号隔开来微调多图任务: image

请问按照这种方式微调完成后,推理的时候我可以按照intern-vl原有的的多图推理方式进行推理么 ,就是图中的torch.cat方式: image

hjh0119 commented 3 days ago

对多图我们也是这么处理的 https://github.com/modelscope/swift/blob/main/swift/llm/utils/template.py#L1231-L1236

fourierer commented 3 days ago

对多图我们也是这么处理的 https://github.com/modelscope/swift/blob/main/swift/llm/utils/template.py#L1231-L1236

感谢您的回复,我这边在微调多图任务时报了这个错误 image 我的数据格式是这样的,images对应一个列表,该列表中包括两张图像: image

"images": [ "/mnt/data/code/banqun.sz/intern-vl/SFT/max0619_is_syn/cspuurl/https:ççimg.alicdn.comçimgextraçi4ç6000000006629çO1CN01Amf9Ro1yq8TjEGrT5!!6000000006629-0-alihealth_ic.jpg", "/mnt/data/code/banqun.sz/intern-vl/SFT/max0619_is_syn/skudetection/https:ççimg.alicdn.comçimgextraçi2ç2113790279çTB28plhX3JkpuFjSszcXXXfsFXa!!2113790279.jpg/split_0.jpeg" ], 这样写是否符合要求呢?还是说需要把多张图写在一个字符串元素里面

fourierer commented 2 days ago

我这边把这里的assert语句注释掉就可以训练了,这里限制了images对应的长度不能超过1 image