add forbidden modules

Former-commit-id: c9f4d051d0eca7515bab201afdef17f1ac1b3cb9
This commit is contained in:
hiyouga
2024-11-23 18:34:15 +00:00
parent 5003820a6a
commit bc4421eeef
2 changed files with 6 additions and 2 deletions

View File

@@ -191,6 +191,8 @@ def patch_target_modules(
if finetuning_args.freeze_vision_tower:
if model_type in ["llava", "llava_next", "llava_next_video", "paligemma", "pixtral", "video_llava"]:
return "^(?!.*vision_tower).*(?:{}).*".format("|".join(target_modules))
elif model_type == "mllama":
return "^(?!.*vision_model).*(?:{}).*".format("|".join(target_modules))
elif model_type == "qwen2_vl":
return "^(?!.*visual).*(?:{}).*".format("|".join(target_modules))
else: