Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何指定只冻结 LLM 进行多模态模型的训练? #6484

Open
1 task done
Ben81828 opened this issue Dec 30, 2024 · 1 comment
Open
1 task done

如何指定只冻结 LLM 进行多模态模型的训练? #6484

Ben81828 opened this issue Dec 30, 2024 · 1 comment
Labels
pending This problem is yet to be addressed

Comments

@Ben81828
Copy link

Reminder

  • I have read the README and searched the existing issues.

System Info

我目前在使用 qwen-vl2 2B 模型,并在我的数据集上进行 LoRA 训练。

现在我想进行不同架构的冻结后性能测试。

根据文档,目前我已知可以使用 freeze_vision_tower 和 train_mm_proj_only 来指定冻结 vision tower,或者冻结 vision tower 和 LM(如图中的 stage 2 和 stage 3)。

但我想请教的是,有没有方法可以指定只冻结 LM 进行 LoRA 训练?(就像图中的 stage 1 那样)

image

Reproduction

Expected behavior

Others

@github-actions github-actions bot added the pending This problem is yet to be addressed label Dec 30, 2024
@TimeFlysLeo
Copy link

可以在workflow load_model之后添加自己要解冻的部分
llava1_5_train_layers = [...]
for lay_name, param in model.named_parameters():
if lay_name in llava1_5_train_layers:
param.requires_grad = True
else:
param.requires_grad = False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants