MaartenGr / KeyBERT

Minimal keyword extraction with BERT
https://MaartenGr.github.io/KeyBERT/
MIT License
3.31k stars 337 forks source link

RepositoryNotFoundError: 401 Client Error #171

Open yudhiesh opened 1 year ago

yudhiesh commented 1 year ago

Issue

The default value of model="all-MiniLM-L6-v2" throws an error due to the model not being found on HuggingFace:

RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-64599ec7-55ee4d860d9461c170c5b5d6)

Repository Not Found for url: https://huggingface.co/multi-qa-MiniLM-L6-cos-v1/resolve/main/config.json.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password.

Link to the model on HuggingFace which throws a 404 Error.

Workaround

I switched over to another model that was still available on HuggingFace like so:

from transformers.pipelines import pipeline
from keybert import KeyBERT

hf_model = pipeline("feature-extraction", model="DataikuNLP/paraphrase-albert-small-v2")
kw_model = KeyBERT(model=hf_model)

Reference

Others are facing the same issue as per this thread https://github.com/UKPLab/sentence-transformers/issues/1915

MaartenGr commented 1 year ago

Thanks for sharing this! You can also find more information at their Twitter handle. You could also see if you have any of the models cached and load them locally but I am quite sure HuggingFace is working hard on a fix seeing the large dependencies of OSS on sentence-transformers.