How to properly handle model versions
I’m trying to figure out what is the right way to upload different versions of models to the hub and then download them (preferably using the string identifiers).For example if my repo isichernev/my-modelhow do I pushv1andv2to it (github tags/branches maybe?), and then, when using it, how do I reference a version (something likeichernev/my-model:v1?). Is there a way to use github sha IDs when referencing models infrom_pretrained/pipelinefunctions?
2022-10-21T10:55:41Z
You can push different versions as different commits. You can use therevisionparameter to point to the specific commit hash when downloading.FromModelsrevision(str,optional, defaults to"main") — The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a git-based system for storing models and other artifacts onhuggingface.co, sorevisioncan be any identifier allowed by git.This also works with branches if you want to, but different commits for different versions makes sense!
2023-11-17T15:08:59Z
I have a follow up question on this topic.What is the purpose of having the flexibility of creating different branches of a model (in ui) whilst not being able to push a model to it using trainer.push_to_hub ? I might not be understanding the use-case of model branches.I am new to the framework so trying to understand best practise for model versioning as well.