Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download model too slow, is there any way #1934

Closed
bigzhouj opened this issue Nov 25, 2019 · 8 comments
Closed

Download model too slow, is there any way #1934

bigzhouj opened this issue Nov 25, 2019 · 8 comments

Comments

@bigzhouj
Copy link

bigzhouj commented Nov 25, 2019

in run_lm_finetuning.py
transformers.file_utils - https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-pytorch_model.bin not found in cache or force_download set to True, downloading to ....

@LysandreJik
Copy link
Member

If your model download is too slow and fails, you can manually download it from our S3 using your browser, wget or cURL as an alternative method.

You can then point to a directory that has both the model weights (xxx-pytorch_model.bin) and the configuration file (xxx-config.json) instead of the checkpoint name as the argument for run_lm_finetuning.py.

@karajan1001
Copy link
Contributor

The models on s3 are downloaded by botocore. And can be accelerated using a proxy. Detailed information can be found on .
Because It only supports http proxy now, other form of proxies like socks5 need to be converted to a http form.

@bigzhouj
Copy link
Author

OSError: Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-config.json' to download pretrained model configuration file.

@karajan1001
Copy link
Contributor

karajan1001 commented Nov 26, 2019

@bigzhouj
Copy link
Author

It can be opened in a browser

@bigzhouj
Copy link
Author

in run_lm_finetuning.py,
probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.bool), value=0.0).
Why does dtyped equal torch.bool?
I have a difficulty here:
Expected object of scalar type Byte but got scalar type Bool for argument #2 'mask'

@TheEdoardo93
Copy link

TheEdoardo93 commented Nov 26, 2019

Tipically, when you say masked *, you want to use boolean values (0 for absence and 1 for presence). In this particular case (rows n.144-151), you are sampling some tokens in the in each sequence for masked language modeling. For this reason, the probability_matrix variable is being set to boolean values. In fact, the first argument of the masked_fill() method is a boolean Torch tensor (i.e. the boolean vector). You can read more info in the PyTorch docs here.

For what concern your issue, post the code for reproducibility and version of TensorFlow, PyTorch, Transformers.

in run_lm_finetuning.py,
probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.bool), value=0.0).
Why does dtyped equal torch.bool?
I have a difficulty here:
Expected object of scalar type Byte but got scalar type Bool for argument #2 'mask'

@LysandreJik
Copy link
Member

@bigzhouj this is probably due to a Pytorch version error. I believe bool was introduced in pytorch v1.2.0. What is your Pytorch version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants