sync with former

Former-commit-id: 9ddb84052e3cc72e21a92b8103caa179a35859c4
This commit is contained in:
Kingsley 2024-09-30 20:27:05 +08:00
parent ececd68f9a
commit 6729ed2c7e

View File

@ -186,12 +186,10 @@ def patch_target_modules(
"""
model_type = getattr(config, "model_type", None)
if finetuning_args.freeze_vision_tower:
if model_type in ["llava", "llava_next", "llava_next_video", "paligemma", "video_llava"]:
if model_type in ["llava", "llava_next", "llava_next_video", "paligemma", "pixtral", "video_llava"]:
return "^(?!.*vision_tower).*(?:{}).*".format("|".join(target_modules))
elif model_type == "qwen2_vl":
return "^(?!.*visual).*(?:{}).*".format("|".join(target_modules))
elif model_type == "pixtral":
return "^(?!.*vision_encoder).*(?:{}).*".format("|".join(target_modules))
else:
return target_modules
else: