mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-06 13:42:51 +08:00
add v1 hf tags
Former-commit-id: 0ca0f08162b18d326787939f12bb5ba07904fb4a
This commit is contained in:
parent
0b1c20eada
commit
6b98435a53
@ -87,6 +87,17 @@ def load_model_and_tokenizer(
|
|||||||
**config_kwargs,
|
**config_kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add llama-factory tag to push these tags on the Hub.
|
||||||
|
# the feature is available since 4.37.0 but adding the check
|
||||||
|
# just in case
|
||||||
|
if hasattr(model, "add_model_tags"):
|
||||||
|
model.add_model_tags(["llama-factory"])
|
||||||
|
else:
|
||||||
|
logger.warning_once(
|
||||||
|
"Was not able to properly tag the model, if you want to use the model tagging feature, make sure to "
|
||||||
|
"have transformers>=4.37.0 installed on your environment."
|
||||||
|
)
|
||||||
|
|
||||||
patch_model(model, tokenizer, model_args, is_trainable)
|
patch_model(model, tokenizer, model_args, is_trainable)
|
||||||
register_autoclass(config, model, tokenizer)
|
register_autoclass(config, model, tokenizer)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user