Using HuggingFace on no-free-internet-access server
How can I have pre-trained models from HuggingFace when I run any model on a limited server to free internet? Because it cannot download the pre-trained model parameters and then use them. Is there any way to download whatever needed for any model like BERT to my local and then transfer it to my server?
2021-10-30T00:10:15Z
When loading a model from pretrained, you can pass the model’s name to be obtained from Hugging Face servers, or you can pass the path of the pretrained model.On a computer with internet access, load a pretrained model by passing the name of the model to be downloaded, then save it and move it to the computer without internet access.model.save_pretrained("./your_file_name")In the computer without internet access, load the pretrained model by passing the path of the file you downloaded earlier and moved here.BertModel.from_pretrained("./your_file_name")
2021-11-01T08:12:41Z
or you could also justgit clonethe model repo locally and move it around (and then use from_pretrained on the local directory as@SMMousavisuggests)
2023-08-28T08:10:58Z
by using save_pretrained it downloads only model bin file but not the safe tensors file .is safe tensors actually needed for inference ?