I have a model that I pushed to the remote using the following code:
from transformers import CLIPProcessor, CLIPModel
checkpoint = "./checkpoints-15/checkpoint-60"
model = CLIPModel.from_pretrained(checkpoint)
processor = CLIPProcessor.from_pretrained(checkpoint)
repo = "vincentclaes/emoji-predictor"
model.push_to_hub(repo, use_temp_dir=True)
processor.push_to_hub(repo, use_temp_dir=True)
On the UI I see my model under a main
branch:
What if I want to store multiple versions of a model?
How do I do this using the huggingface tools?
Thinking transformers
, huggingface_hub
, ...
If you want to load a specific version or revision of a model from a specific branch, you can use the revision parameter
here the detail: https://huggingface.co/docs/transformers/main_classes/model#transformers.PreTrainedModel.from_pretrained.revision
So if you have different branch e.g "v2.0" you can add revision parameter as "v2.0"
model = CLIPModel.from_pretrained("vincentclaes/emoji-predictor", revision="v2.0")