Skip to content

Commit 8f9f7d1

Browse files
authored
CHORE: Use faster test translation scenario, cut CI time by ~5mins (#3046)
* Use faster test translation scenario * Try change protobuf * Session scope * Try pin protobuf * Typo * Pin protobuf again * Update pyproject.toml * Fixup docs
1 parent 9d72ec7 commit 8f9f7d1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ test = [
5050
"pyspark",
5151
"pyod",
5252
"transformers",
53+
"protobuf==3.20.3", # See GH #3046
5354
"torch",
5455
"torchvision",
5556
"tensorflow",

tests/explainers/conftest.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ def basic_translation_scenario():
1111
AutoTokenizer = pytest.importorskip("transformers").AutoTokenizer
1212
AutoModelForSeq2SeqLM = pytest.importorskip("transformers").AutoModelForSeq2SeqLM
1313

14-
tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-es")
15-
model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-en-es")
14+
# Use a *tiny* tokenizer model, to keep tests running as fast as possible.
15+
# Nb. At time of writing, this pretrained model requires "protobuf==3.20.3".
16+
name = "mesolitica/finetune-translation-t5-super-super-tiny-standard-bahasa-cased"
17+
tokenizer = AutoTokenizer.from_pretrained(name)
18+
model = AutoModelForSeq2SeqLM.from_pretrained(name)
1619

1720
# define the input sentences we want to translate
1821
data = [

0 commit comments

Comments
 (0)