mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-29 02:00:36 +08:00
[model] adds semantic initialization support for special tokens (#9267)
Co-authored-by: ximingxing <ximingxing@tencent.com>
This commit is contained in:
@@ -175,7 +175,12 @@ def patch_model(
|
||||
prepare_valuehead_model(model)
|
||||
|
||||
if model_args.resize_vocab:
|
||||
resize_embedding_layer(model, tokenizer)
|
||||
resize_embedding_layer(
|
||||
model,
|
||||
tokenizer,
|
||||
new_special_tokens_config=getattr(model_args, "_special_token_descriptions", None),
|
||||
init_special_tokens=model_args.init_special_tokens,
|
||||
)
|
||||
|
||||
if is_trainable:
|
||||
if getattr(model.config, "model_type", None) == "gemma3n":
|
||||
|
||||
Reference in New Issue
Block a user