HF / FEAT: Optimize HF tags (#1425) [skip ci]

* optimize tags

* chore: lint

---------

Co-authored-by: Wing Lian <wing.lian@gmail.com>
This commit is contained in:
Younes Belkada
2024-03-21 16:55:56 +01:00
committed by GitHub
parent 7803f0934f
commit 7d55607368

View File

@@ -793,6 +793,12 @@ class TrainerBuilderBase(abc.ABC):
self.model = model
self.tokenizer = tokenizer
# in case the model supports tagging, add the axolotl tag.
# This makes sure the tag is correctly pushed even if a user calls
# model.push_to_hub instad of trainer.push_to_hub.
if hasattr(model, "add_model_tags"):
model.add_model_tags(["axolotl"])
@property
def model_ref(self):
return self._model_ref