huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
134.73k stars 26.94k forks source link

help:OSError: Model name 'ctrl' was not found in tokenizers model name list (ctrl). We assumed 'ctrl' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.json', 'merges.txt'] but couldn't find such vocabulary files at this path or url. #5702

Closed Heiheiyo closed 4 years ago

Heiheiyo commented 4 years ago

❓ Questions & Help

image

Kreijstal commented 4 years ago

As for me, I'm getting

OSError: Can't load weights for 'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es'. Make sure that:

- 'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es' is the correct path to a directory containing a file named one of tf_model.h5, pytorch_model.bin.

the line of code is

nlp = pipeline(
    'question-answering', 
    model='mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es',
    tokenizer=(
        'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es',  
        {"use_fast": False}
    )
)

but my question is, why does pipeline download the model but can't load/find the weights?? I'm using python:3.7 dockerimage. I'm using tf version '2.2.0'

LysandreJik commented 4 years ago

@Heiheiyo, is it possible you have a ctrl folder that does not contain the vocab and merges files? When running your command on master I have no issues with CTRL.

LysandreJik commented 4 years ago

@Kreijstal, on what version of transformers are you running? I copy-pasted your command and it works fine on the master branch.

Heiheiyo commented 4 years ago

@LysandreJik Thank you for your answer.I have solved this problem.I downloaded the ctrl model and modified the model file path.

Kreijstal commented 4 years ago

@LysandreJik I solved this problem too, I used the dockerfiles I found on this repo to figure out the right libraries that might not have been installed