This is how I install Hugginface
!pip install transformers==2.4.1
!pip install pytorch-transformers==1.2.0
!pip install tensorboardX
After that I load the pretrained XLM using the args I listed earlier.
Collecting transformers==2.4.1
Downloading https://files.pythonhosted.org/packages/ee/fc/bd726a15ab2c66dc09306689d04da07a3770dad724f0883f0a4bfb745087/transformers-2.4.1-py3-none-any.whl (475kB)
|████████████████████████████████| 481kB 6.3MB/s
Requirement already satisfied: filelock in /usr/local/lib/python3.6/dist-packages (from transformers==2.4.1) (3.0.12)
Collecting sentencepiece
Downloading https://files.pythonhosted.org/packages/98/2c/8df20f3ac6c22ac224fff307ebc102818206c53fc454ecd37d8ac2060df5/sentencepiece-0.1.86-cp36-cp36m-manylinux1_x86_64.whl (1.0MB)
|████████████████████████████████| 1.0MB 19.5MB/s
Collecting sacremoses
Downloading https://files.pythonhosted.org/packages/99/50/93509f906a40bffd7d175f97fd75ea328ad9bd91f48f59c4bd084c94a25e/sacremoses-0.0.41.tar.gz (883kB)
|████████████████████████████████| 890kB 40.6MB/s
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from transformers==2.4.1) (2.21.0)
Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.6/dist-packages (from transformers==2.4.1) (2019.12.20)
Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.6/dist-packages (from transformers==2.4.1) (4.38.0)
Requirement already satisfied: boto3 in /usr/local/lib/python3.6/dist-packages (from transformers==2.4.1) (1.12.43)
Collecting tokenizers==0.0.11
Downloading https://files.pythonhosted.org/packages/5e/36/7af38d572c935f8e0462ec7b4f7a46d73a2b3b1a938f50a5e8132d5b2dc5/tokenizers-0.0.11-cp36-cp36m-manylinux1_x86_64.whl (3.1MB)
|████████████████████████████████| 3.1MB 40.1MB/s
These two lines are resulting in the error:
config = config_class.from_pretrained(args['model_name'], num_labels=2, finetuning_task=args['task_name'])
tokenizer = tokenizer_class.from_pretrained(args['model_name'])
I think intuitively that this is what changed somehow:
INFO:pytorch_transformers.modeling_utils:loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/xlm-clm-ende-1024-pytorch_model.bin from cache at /root/.cache/torch/pytorch_transformers/5a816efe624c800afaf4f903fae30944e1d8d44c13dec7e924434a02fdd585e1.b741240cfb67fdf78fd931f6e246356fa1f054ef272dbeae43d5d659d520b07d