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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cache_dir argument in run_lm_finetuning.py not used at all #1623

Closed
2 tasks
mpavlovic opened this issue Oct 24, 2019 · 0 comments
Closed
2 tasks

--cache_dir argument in run_lm_finetuning.py not used at all #1623

mpavlovic opened this issue Oct 24, 2019 · 0 comments

Comments

@mpavlovic
Copy link

馃悰 Bug

Model I am using (Bert, XLNet....): GPT-2

Language I am using the model on (English, Chinese....): English

The problem arise when using:

  • the official example scripts: run_lm_finetuning.py

The tasks I am working on is:

  • my own task or dataset: Language model finetuning on custom dataset from human resources domain

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo
  2. Navigate to transformers/examples directory
  3. Prepare custom train and test datasets (.txt files)
  4. Create ./cache directory
  5. Run the following command in terminal (with replaced custom_ arguments):
python run_lm_finetuning.py \
   --output_dir=<custom_output_dir_path> \
   --model_type=gpt2 \
   --model_name_or_path=gpt2 \
   --do_train \
   --train_data_file=<custom_train_data_file> \
   --do_eval \
   --eval_data_file=<custom_eval_data_file> \
   --per_gpu_eval_batch_size=1   \
   --per_gpu_train_batch_size=1   \
   --save_total_limit=2 \
   --num_train_epochs=1 \
   --cache_dir=./cache

Expected behavior

When the model is downloaded from S3, it is stored to default cache directory in <user_home>/.cache/transformers/ directory, instead to ./cache, as specified in --cache_dir argument. Seems like --cache_dir argument isn't used in .from_pretrained() methods in lines 472, 473 and 477 in the run_lm_finetuning.py script.

Environment

  • OS: Ubuntu 18.04
  • Python version: 3.6.6
  • PyTorch version: 1.3
  • PyTorch Transformers version (or branch): 2.1.1
  • Using GPU ? Yes
  • Distributed of parallel setup ? No
  • Any other relevant information:

Additional context

@mpavlovic mpavlovic changed the title cache_dir argument in run_lm_finetuning.py not used at all --cache_dir argument in run_lm_finetuning.py not used at all Oct 24, 2019
thomwolf added a commit that referenced this issue Nov 5, 2019
graehl added a commit to graehl/pytorch-transformers that referenced this issue Nov 6, 2019
* upstream/master:
  Add RoBERTa-based GPT-2 Output Detector from OpenAI
  Fix other PyTorch models
  Fix BERT
  [tests] Flag to test on cuda
  [tests] get rid of warning
  [run_tf_glue] Add comment for context
  misc doc
  Updating docblocks in optimizers.py
  GPT-2 XL
  add authors for models
  Fix huggingface#1686
  add progress bar for convert_examples_to_features
  [inputs_embeds] All PyTorch models
  docstring + check
  model forwards can take an inputs_embeds param
  Fix huggingface#1623
  Fixing mode in evaluate during training
  Add speed log to examples/run_squad.py
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

1 participant