araT5 icon indicating copy to clipboard operation
araT5 copied to clipboard

OSError: Can't load config for 'UBC-NLP/AraT5-base'.

Open mellahysf opened this issue 2 years ago • 1 comments

Hi,

I want to run your scripts run_trainier_seq2seq_huggingface.py but it gives me the folowing error:

last_checkpoint None 03/26/2022 14:49:11 - WARNING - main - Process rank: -1, device: cuda:0, n_gpu: 1distributed training: False, 16-bits training: False 03/26/2022 14:49:11 - INFO - main - Training/evaluation parameters Seq2SeqTrainingArguments(output_dir='/content/AraT5_FT_title_generation', overwrite_output_dir=True, do_train=True, do_eval=True, do_predict=False, evaluation_strategy=<IntervalStrategy.EPOCH: 'epoch'>, prediction_loss_only=False, per_device_train_batch_size=8, per_device_eval_batch_size=8, per_gpu_train_batch_size=None, per_gpu_eval_batch_size=None, gradient_accumulation_steps=1, eval_accumulation_steps=None, learning_rate=5e-05, weight_decay=0.0, adam_beta1=0.9, adam_beta2=0.999, adam_epsilon=1e-08, max_grad_norm=1.0, num_train_epochs=3.0, max_steps=-1, lr_scheduler_type=<SchedulerType.LINEAR: 'linear'>, warmup_ratio=0.0, warmup_steps=0, logging_dir='runs/Mar26_14-49-11_1f6d9e124699', logging_strategy=<IntervalStrategy.EPOCH: 'epoch'>, logging_first_step=False, logging_steps=500, save_strategy=<IntervalStrategy.STEPS: 'steps'>, save_steps=500, save_total_limit=None, no_cuda=False, seed=42, fp16=False, fp16_opt_level='O1', fp16_backend='auto', fp16_full_eval=False, local_rank=-1, tpu_num_cores=None, tpu_metrics_debug=False, debug=False, dataloader_drop_last=False, eval_steps=500, dataloader_num_workers=0, past_index=-1, run_name='/content/AraT5_FT_title_generation', disable_tqdm=False, remove_unused_columns=True, label_names=None, load_best_model_at_end=True, metric_for_best_model='eval_bleu', greater_is_better=True, ignore_data_skip=False, sharded_ddp=[], deepspeed=None, label_smoothing_factor=0.0, adafactor=False, group_by_length=False, length_column_name='length', report_to=['tensorboard'], ddp_find_unused_parameters=None, dataloader_pin_memory=True, skip_memory_metrics=False, mp_parameters='', sortish_sampler=False, predict_with_generate=True) [INFO] loading from TSV 03/26/2022 14:49:11 - WARNING - datasets.builder - Using custom data configuration default-942a41af4b2c6152 Downloading and preparing dataset csv/default to /tmp/AraT5_cache_dir/csv/default-942a41af4b2c6152/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519... Downloading data files: 100% 2/2 [00:00<00:00, 9446.63it/s] Extracting data files: 100% 2/2 [00:00<00:00, 985.16it/s] Dataset csv downloaded and prepared to /tmp/AraT5_cache_dir/csv/default-942a41af4b2c6152/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519. Subsequent calls will reuse this data. 100% 2/2 [00:00<00:00, 803.74it/s] Cannot find the requested files in the cached path and outgoing traffic has been disabled. To enable model look-ups and downloads online, set 'local_files_only' to False. Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/transformers/configuration_utils.py", line 466, in get_config_dict user_agent=user_agent, File "/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py", line 1173, in cached_path local_files_only=local_files_only, File "/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py", line 1383, in get_from_cache "Cannot find the requested files in the cached path and outgoing traffic has been" FileNotFoundError: Cannot find the requested files in the cached path and outgoing traffic has been disabled. To enable model look-ups and downloads online, set 'local_files_only' to False.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run_trainier_seq2seq_huggingface.py", line 807, in main() File "run_trainier_seq2seq_huggingface.py", line 365, in main local_files_only = True File "/usr/local/lib/python3.7/dist-packages/transformers/models/auto/configuration_auto.py", line 398, in from_pretrained config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) File "/usr/local/lib/python3.7/dist-packages/transformers/configuration_utils.py", line 478, in get_config_dict raise EnvironmentError(msg) OSError: Can't load config for 'UBC-NLP/AraT5-base'. Make sure that:

  • 'UBC-NLP/AraT5-base' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'UBC-NLP/AraT5-base' is the correct path to a directory containing a config.json file

How to fix it please?

mellahysf avatar Mar 26 '22 14:03 mellahysf

Hi @mellahysf, Thanks for your comment. The model's name is correct. You faced this issue because the code enforce to load the model from local files. We've disabled (local_files_only = True) lines (365, 374, 383, and 392) to allow the trainer to load the models from Huggingface (online). Try the code now, it should work now. Thanks

elmadany avatar Apr 01 '22 19:04 elmadany