Problems loading pre-trained embeddings in offline environment


I’m having problems loading a pre-trained embedding that’s part of a trained model’s pipeline.

The environment where the API will be running have it’s internet traffic heavily restricted, and will be serving mainly as sentence classifier instead of as a full fledged chatbot.

So the models are trained in a “unrestricted” environment and are later copied to the production environment along the embedding files downloaded/cached by huggingface during training.

When I try to start the server in the “restricted env” I receive the error:

[ERROR] Could not load model due to Can't load weights for 'bert-base-multilingual-uncased'. Make sure that:

  • 'bert-base-multilingual-uncased' is a correct model identifier listed on ''
  • or 'bert-base-multilingual-uncased' is the correct path to a directory containing a file named one of tf_model.h5, pytorch_model.bin.

But starting the same model and cached files in the “unrestricted env” returns:

transformers.modeling_tf_utils - loading weights file from cache at cache/bert-base-multilingual-uncased/7d28670bd470eb4cdca259c871e3f6c0502522d30a678305c1cccf3c8bfcb6da.25728a4fd7ddaafee2965f5821a206f237b83c672e0bb092881f9b1f5eea2b2f.h5

Is there a way to avoid that “verification” phase before loading the cached embeddings? Can I load embeddings in an offline environment?