mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 22:02:51 +08:00
Former-commit-id: a12a506c3d2ba85975a5990c46d2e055cdfe0f2e
This commit is contained in:
parent
cafbb79d3a
commit
3fcb678d00
@ -101,6 +101,10 @@ class ModelArguments:
|
||||
default=False,
|
||||
metadata={"help": "Whether or not to upcast the output of lm_head in fp32."},
|
||||
)
|
||||
train_from_scratch: bool = field(
|
||||
default=False,
|
||||
metadata={"help": "Whether or not to randomly initialize the model weights."},
|
||||
)
|
||||
infer_backend: Literal["huggingface", "vllm"] = field(
|
||||
default="huggingface",
|
||||
metadata={"help": "Backend engine used at inference."},
|
||||
|
@ -131,6 +131,8 @@ def load_model(
|
||||
model = load_mod_pretrained_model(**init_kwargs)
|
||||
elif model_args.visual_inputs:
|
||||
model = AutoModelForVision2Seq.from_pretrained(**init_kwargs)
|
||||
elif model_args.train_from_scratch:
|
||||
model = AutoModelForCausalLM.from_config(config)
|
||||
else:
|
||||
model = AutoModelForCausalLM.from_pretrained(**init_kwargs)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user