Skip to content

Commit eed80d3

Browse files
authored
Use the main branch of Transformers in CI (huggingface#124)
1 parent 4a16dd5 commit eed80d3

11 files changed

+46
-12
lines changed

Makefile

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,25 @@ fast_tests_diffusers:
4040
python -m pytest tests/test_diffusers.py
4141

4242
# Run single-card non-regression tests
43-
slow_tests_1x:
44-
python -m pip install .[tests]
43+
slow_tests_1x: test_installs
4544
python -m pytest tests/test_examples.py -v -s -k "single_card"
4645

4746
# Run multi-card non-regression tests
48-
slow_tests_8x:
49-
python -m pip install .[tests]
47+
slow_tests_8x: test_installs
5048
python -m pytest tests/test_examples.py -v -s -k "multi_card"
5149

5250
# Run DeepSpeed non-regression tests
53-
slow_tests_deepspeed:
54-
python -m pip install .[tests]
51+
slow_tests_deepspeed: test_installs
5552
python -m pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.7.0
5653
python -m pytest tests/test_examples.py -v -s -k "deepspeed"
5754

58-
slow_tests_diffusers:
59-
python -m pip install .[tests]
55+
slow_tests_diffusers: test_installs
56+
python -m pip install git+https://github.com/huggingface/diffusers.git
6057
python -m pip install ftfy
6158
python -m pytest tests/test_diffusers.py -v -s -k "test_no_"
6259

6360
# Check if examples are up to date with the Transformers library
64-
example_diff_tests:
65-
python -m pip install .[tests]
61+
example_diff_tests: test_installs
6662
python -m pytest tests/test_examples_match_transformers.py
6763

6864
# Utilities to release to PyPi
@@ -96,3 +92,7 @@ clean:
9692
find . -name "habana_log.livealloc.log_*" -type f -delete
9793
find . -name .lock -type f -delete
9894
find . -name .graph_dumps -type d -delete
95+
96+
test_installs:
97+
python -m pip install .[tests]
98+
python -m pip install git+https://github.com/huggingface/transformers.git

tests/example_diff/run_audio_classification.txt

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
> from optimum.habana import GaudiConfig, GaudiTrainer, GaudiTrainingArguments
1313
> from optimum.habana.utils import set_seed
1414
> from transformers import AutoConfig, AutoFeatureExtractor, AutoModelForAudioClassification, HfArgumentParser
15+
48c42
16+
< check_min_version("4.26.0.dev0")
17+
---
18+
> check_min_version("4.25.0")
1519
164,166d157
1620
< freeze_feature_extractor: Optional[bool] = field(
1721
< default=None, metadata={"help": "Whether to freeze the feature extractor layers of the model."}

tests/example_diff/run_clm.txt

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
47,48d45
1919
< is_torch_tpu_available,
2020
< set_seed,
21+
57c54
22+
< check_min_version("4.26.0.dev0")
23+
---
24+
> check_min_version("4.25.0")
2125
78c75,76
2226
< "The model checkpoint for weights initialization.Don't set if you want to train a model from scratch."
2327
---

tests/example_diff/run_glue.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
< TrainingArguments,
77
43d42
88
< set_seed,
9+
51c50
10+
< check_min_version("4.26.0.dev0")
11+
---
12+
> check_min_version("4.25.0")
913
211c210
1014
< parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
1115
---

tests/example_diff/run_image_classification.txt

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
< Trainer,
66
< TrainingArguments,
77
< set_seed,
8+
58c57
9+
< check_min_version("4.26.0.dev0")
10+
---
11+
> check_min_version("4.25.0")
812
171c170
913
< parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
1014
---

tests/example_diff/run_mlm.txt

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
< TrainingArguments,
1414
< is_torch_tpu_available,
1515
< set_seed,
16+
56c53
17+
< check_min_version("4.26.0.dev0")
18+
---
19+
> check_min_version("4.25.0")
1620
220c217
1721
< parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
1822
---

tests/example_diff/run_qa.txt

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
< TrainingArguments,
1010
43d43
1111
< set_seed,
12+
52c52
13+
< check_min_version("4.26.0.dev0")
14+
---
15+
> check_min_version("4.25.0")
1216
135c135
1317
< " batching to the maximum length in the batch (which can be faster on GPU but will be slower on TPU)."
1418
---

tests/example_diff/run_speech_recognition_ctc.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
< TrainingArguments,
77
45d44
88
< set_seed,
9+
53c52
10+
< check_min_version("4.26.0.dev0")
11+
---
12+
> check_min_version("4.25.0")
913
140d138
1014
<
1115
373c371

tests/example_diff/run_summarization.txt

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
< set_seed,
1212
---
1313
> default_data_collator,
14+
55c55
15+
< check_min_version("4.26.0.dev0")
16+
---
17+
> check_min_version("4.25.0")
1418
203c203
1519
< "efficient on GPU but very bad for TPU."
1620
---

tests/example_diff/run_translation.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
< Seq2SeqTrainingArguments,
77
47d46
88
< set_seed,
9+
55c54
10+
< check_min_version("4.26.0.dev0")
11+
---
12+
> check_min_version("4.25.0")
913
171c170
1014
< "efficient on GPU but very bad for TPU."
1115
---

tests/test_examples_match_transformers.py

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ def get_examples(
4949

5050

5151
cloned_repo = Repo.clone_from(TRANSFORMERS_REPO_URL, TRANSFORMERS_REPO_PATH)
52-
latest_tag = sorted(cloned_repo.tags, key=lambda t: t.commit.committed_datetime)[-1]
53-
cloned_repo.git.checkout(latest_tag)
5452
EXAMPLES = get_examples(TRANSFORMERS_REPO_PATH / "examples" / "pytorch", "examples")
5553

5654

0 commit comments

Comments
 (0)