mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
added generation examples in tests
This commit is contained in:
parent
8bb02c27e2
commit
c490f5ce87
@ -98,12 +98,12 @@ class ExamplesTests(unittest.TestCase):
|
||||
|
||||
testargs = ["run_generation.py",
|
||||
"--prompt=Hello",
|
||||
"--length=10",
|
||||
"--seed=42"]
|
||||
model_name = "--model_name=openai-gpt"
|
||||
with patch.object(sys, 'argv', testargs + [model_name]):
|
||||
result = run_generation.main()
|
||||
self.assertGreaterEqual(result['f1'], 30)
|
||||
self.assertGreaterEqual(result['exact'], 30)
|
||||
self.assertGreaterEqual(len(result), 10)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user