FileNotFound error downloading roberta-model sentence transformers

505 Views Asked by At

I've already downloaded the "roberta-large-nli-stsb-mean-tokens" model, but it starts downloading again and again. Note: This is not related to space, the machine has space. And this error comes...FileNotFoundError

from sentence_transformers import SentenceTransformer

model = SentenceTransformer('roberta-large-nli-stsb-mean-tokens')
2

There are 2 best solutions below

0
On

Notice the exception right above the one that you're asking about. It can't save the file, you're out of disk space.

0
On

Have you tried this?

model = SentenceTransformer('sentence-transformers/roberta-large-nli-stsb-mean-tokens')

If you want to use a downloaded model from disk, it looks like this:

word_embedding_model = models.Transformer(model_path)
pooling_model = models.Pooling(word_embedding_model.get_word_embedding_dimension())
model = SentenceTransformer(modules=[word_embedding_model, pooling_model])