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

Function test_run_eval_bart

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

Source from the content-addressed store, hash-verified

193
194@pytest.mark.parametrize(["model"], [pytest.param(T5_TINY), pytest.param(BART_TINY), pytest.param(MBART_TINY)])
195def test_run_eval_bart(model):
196 input_file_name = Path(tempfile.mkdtemp()) / "utest_input.source"
197 output_file_name = input_file_name.parent / "utest_output.txt"
198 assert not output_file_name.exists()
199 articles = [" New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County."]
200 _dump_articles(input_file_name, articles)
201 testargs = ["run_eval.py", model, str(input_file_name), str(output_file_name)] # TODO: test score_path
202 with patch.object(sys, "argv", testargs):
203 run_generate()
204 assert Path(output_file_name).exists()
205 os.remove(Path(output_file_name))
206
207
208@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

_dump_articlesFunction · 0.85
run_generateFunction · 0.85

Tested by

no test coverage detected