add llava and instructblip

This commit is contained in:
BUAADreamer
2024-04-25 00:22:43 +08:00
parent e1afbea68f
commit cfb485eddf
22 changed files with 343 additions and 4484 deletions

View File

@@ -191,6 +191,7 @@ def load_mm_model(
finetuning_args: "FinetuningArguments",
is_trainable: bool = False,
add_valuehead: bool = False,
use_clm=True,
) -> "AutoModelForVision2Seq":
r"""
Loads pretrained model. Must after load_tokenizer.
@@ -231,7 +232,7 @@ def load_mm_model(
patch_model(model, tokenizer, model_args, is_trainable)
register_autoclass(config, model, tokenizer)
model = init_mm_adapter(model, model_args, finetuning_args, is_trainable)
model = init_mm_adapter(model, model_args, finetuning_args, is_trainable, use_clm)
if not is_trainable:
model.requires_grad_(False)