MCPcopy Create free account
hub / github.com/huggingface/transformers / test_finetune

Function test_finetune

examples/seq2seq/test_seq2seq_examples.py:211–228  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

209 ["model"], [pytest.param(T5_TINY), pytest.param(BART_TINY), pytest.param(MBART_TINY), pytest.param(MARIAN_TINY)]
210)
211def test_finetune(model):
212 args_d: dict = CHEAP_ARGS.copy()
213 task = "translation" if model in [MBART_TINY, MARIAN_TINY] else "summarization"
214 tmp_dir = make_test_data_dir()
215 output_dir = tempfile.mkdtemp(prefix="output_")
216 args_d.update(
217 data_dir=tmp_dir,
218 model_name_or_path=model,
219 tokenizer_name=None,
220 train_batch_size=2,
221 eval_batch_size=2,
222 output_dir=output_dir,
223 do_predict=True,
224 task=task,
225 )
226 assert "n_train" in args_d
227 args = argparse.Namespace(**args_d)
228 main(args)
229
230
231@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

make_test_data_dirFunction · 0.85
updateMethod · 0.80
mainFunction · 0.70

Tested by

no test coverage detected