Skip to content

Commit

Permalink
Revert "New run_clm script (huggingface#8105)"
Browse files Browse the repository at this point in the history
This reverts commit 3bd3960.
  • Loading branch information
fabiocapsouza authored Nov 15, 2020
1 parent a80be67 commit 9d13023
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 379 deletions.
345 changes: 0 additions & 345 deletions examples/language-modeling/run_clm.py

This file was deleted.

33 changes: 0 additions & 33 deletions examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@


if SRC_DIRS is not None:
import run_clm
import run_generation
import run_glue
import run_language_modeling
Expand Down Expand Up @@ -129,38 +128,6 @@ def test_run_pl_glue(self):
# self.assertGreaterEqual(v, 0.75, f"({k})")
#

def test_run_clm(self):
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)

tmp_dir = self.get_auto_remove_tmp_dir()
testargs = f"""
run_clm.py
--model_name_or_path distilgpt2
--train_file ./tests/fixtures/sample_text.txt
--validation_file ./tests/fixtures/sample_text.txt
--do_train
--do_eval
--block_size 128
--per_device_train_batch_size 5
--per_device_eval_batch_size 5
--num_train_epochs 2
--output_dir {tmp_dir}
--overwrite_output_dir
--prediction_loss_only
""".split()

if torch.cuda.device_count() > 1:
# Skipping because there are not enough batches to train the model + would need a drop_last to work.
return

if torch_device != "cuda":
testargs.append("--no_cuda")

with patch.object(sys, "argv", testargs):
result = run_clm.main()
self.assertLess(result["perplexity"], 100)

def test_run_language_modeling(self):
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
Expand Down
Loading

0 comments on commit 9d13023

Please sign in to comment.