Is there an API to re-download a model?
Let’s say I download a modeltransformers.AutoModelForQuestionAnswering.from_pretrained(
"distilbert-base-cased-distilled-squad",
trust_remote_code=True)That saves it in the cache and it won’t download it again in the future.  If I then train it, the model changes, right?  I can re-download it from scratch by deleting it from the cache, but is there an API way to do this?In the future, I’ll download it and then use save_pretrained to save it to a different file and then train the one that I saved outside the cache.
2024-01-03T09:47:47Z
Hi,You can clean your cache as explained here:Manage huggingface_hub cache-system.Yes you can also passforce_download=Trueto thefrom_pretrainedmethod.
2024-01-10T02:20:38Z
Can I ask you a question? When you said,If I then train it, the model changes, right?what does this mean, sir? If I train the model, the cache of this model will change? Do you have a reference for me to read more?
2024-01-10T17:53:46Z
If I train the model, the cache of this model will change?Hi@Nevermetyou, no, training the model has no impact on the cached version of the model.When you download a model, the cached version will be saved in a location specified by theHF_HOMEenvironment variable (you can read morehere). By default, that location is~/.cache/huggingface.On the other hand, when your training finishes, the trained (modified) version of the model will be saved in a folder specified by theoutput_dirargument given to the Huggingface trainer (you can see this arghere)
2024-01-11T05:17:24Z
Thanks for your clarification.
2024-01-11T19:01:31Z
dblakely:On the other hand, when your training finishes, the trained (modified) version of the model will be saved in a folder specified by theoutput_dirargument given to the Huggingface trainer (you can see this arghere)Ah, thanks!