Thanks for this nice work! This PR aims to improve the discoverability of your models by adding a HF integration.
I wrote a quick PoC to showcase that you can easily have integration with the 🤗 hub so that you can
automatically load the model using from_pretrained (and push it using push_to_hub)
track download numbers for your models (similar to models in the Transformers library)
have nice model cards on a per-model basis along with tags (so that people find them when filtering https://hf.co/models) => we could collaborate on adding a dedicated "video-frame-interpolation" tag
perhaps most importantly, leverage safetensors for the weights in favor of pickle.
It leverages the PyTorchModelHubMixin class which allows to inherits these methods.
Usage is as follows:
from model.flow_estimation import MultiScaleFlow
# instantiate model
model = MultiScaleFlow(...)
# equip model with weights
model.load_state_dict(...)
# push to hub
model.push_to_hub("MCG-NJU/ema-vfi")
# reload
model = MultiScaleFlow.from_pretrained("MCG-NJU/ema-vfi")
This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub. Checkpoints could be pushed to https://huggingface.co/MCG-NJU.
Would you be interested in this integration?
Kind regards,
Niels
Note
Please don't merge this PR before pushing the model to the hub :)
Hi @GuozhenZhang1999 and team,
Thanks for this nice work! This PR aims to improve the discoverability of your models by adding a HF integration.
I wrote a quick PoC to showcase that you can easily have integration with the 🤗 hub so that you can
from_pretrained
(and push it usingpush_to_hub
)safetensors
for the weights in favor of pickle.It leverages the PyTorchModelHubMixin class which allows to inherits these methods.
Usage is as follows:
This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub. Checkpoints could be pushed to https://huggingface.co/MCG-NJU.
Would you be interested in this integration?
Kind regards,
Niels
Note
Please don't merge this PR before pushing the model to the hub :)