(model)
| 209 | ["model"], [pytest.param(T5_TINY), pytest.param(BART_TINY), pytest.param(MBART_TINY), pytest.param(MARIAN_TINY)] |
| 210 | ) |
| 211 | def 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( |
nothing calls this directly
no test coverage detected