mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-02 03:32:50 +08:00
support qwen2vl train proj only
Former-commit-id: 99c62660c67fd2567c094bb49ec7d108e5670730
This commit is contained in:
parent
255260cfcb
commit
cf8cad8e7e
@ -6,6 +6,7 @@ stage: sft
|
|||||||
do_train: true
|
do_train: true
|
||||||
finetuning_type: full
|
finetuning_type: full
|
||||||
freeze_vision_tower: true # choices: [true, false]
|
freeze_vision_tower: true # choices: [true, false]
|
||||||
|
train_mm_proj_only: false # choices: [true, false]
|
||||||
deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
|
deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
|
||||||
|
|
||||||
### dataset
|
### dataset
|
||||||
|
@ -138,11 +138,10 @@ def get_forbidden_modules(config: "PretrainedConfig", finetuning_args: "Finetuni
|
|||||||
forbidden_modules.add("language_model")
|
forbidden_modules.add("language_model")
|
||||||
|
|
||||||
elif model_type == "qwen2_vl":
|
elif model_type == "qwen2_vl":
|
||||||
if finetuning_args.freeze_vision_tower:
|
|
||||||
forbidden_modules.add("visual")
|
|
||||||
|
|
||||||
if finetuning_args.train_mm_proj_only:
|
if finetuning_args.train_mm_proj_only:
|
||||||
raise ValueError("Qwen2-VL models do not support `train_mm_proj_only`.")
|
forbidden_modules.update({"visual.patch_embed", "visual.blocks", "model", "lm_head"})
|
||||||
|
elif finetuning_args.freeze_vision_tower:
|
||||||
|
forbidden_modules.add("visual")
|
||||||
|
|
||||||
return forbidden_modules
|
return forbidden_modules
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user