How to move huggingface's pretrained model to another machine?

Hi everyone, I’m having two computers, let’s call them A and B.

On my computer A, I have my huggingface’s textattack/bert-base-uncased-imdb model already downloaded.

My computer B, however, does not have access to the internet and cannot download the model.

A and B can communicate through ssh. Now I’m trying to move the downloaded model from A to B by moving the entire ~/.cache/huggingface to B, but when I run my code on computer B, it still attempts to download the model from the internet.

Maybe the pretrained model in A is located somewhere else? How do I move my model from A to B?

Thanks.

Computer B is still trying to access the internet to check if there is a new version of the model you are using. You have to set the environment variable TRANSFORMERS_OFFLINE to some truthy value (like yes)

2 Likes

It worked!

Thank you so much.

1 Like