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

Method test_generation

examples/test_examples.py:129–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 self.assertGreaterEqual(result["exact"], 21)
128
129 def test_generation(self):
130 stream_handler = logging.StreamHandler(sys.stdout)
131 logger.addHandler(stream_handler)
132
133 testargs = ["run_generation.py", "--prompt=Hello", "--length=10", "--seed=42"]
134 model_type, model_name = ("--model_type=gpt2", "--model_name_or_path=sshleifer/tiny-gpt2")
135 with patch.object(sys, "argv", testargs + [model_type, model_name]):
136 result = run_generation.main()
137 self.assertGreaterEqual(len(result[0]), 10)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected