Can't load weights for 'facebook/bart-base'

OSError: Can’t load weights for ‘facebook/bart-base’. Make sure that:

  • ‘facebook/bart-base’ is a correct model identifier listed on ‘Models - Hugging Face

  • or ‘facebook/bart-base’ is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt

Can anyone please help?

What’s the code you used? What is your environment?

If you are trying to run your code on a server or HPC system and you receive this error, one solution is to first run the step that downloads the model outside of the batch system and then use the downloaded model within the batch system.
This solution resolved my error which was exactly the same error you mentioned here.