Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
c490f5ce
Commit
c490f5ce
authored
Jul 13, 2019
by
thomwolf
Browse files
added generation examples in tests
parent
8bb02c27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/test_examples.py
examples/test_examples.py
+2
-2
No files found.
examples/test_examples.py
View file @
c490f5ce
...
@@ -98,12 +98,12 @@ class ExamplesTests(unittest.TestCase):
...
@@ -98,12 +98,12 @@ class ExamplesTests(unittest.TestCase):
testargs
=
[
"run_generation.py"
,
testargs
=
[
"run_generation.py"
,
"--prompt=Hello"
,
"--prompt=Hello"
,
"--length=10"
,
"--seed=42"
]
"--seed=42"
]
model_name
=
"--model_name=openai-gpt"
model_name
=
"--model_name=openai-gpt"
with
patch
.
object
(
sys
,
'argv'
,
testargs
+
[
model_name
]):
with
patch
.
object
(
sys
,
'argv'
,
testargs
+
[
model_name
]):
result
=
run_generation
.
main
()
result
=
run_generation
.
main
()
self
.
assertGreaterEqual
(
result
[
'f1'
],
30
)
self
.
assertGreaterEqual
(
len
(
result
),
10
)
self
.
assertGreaterEqual
(
result
[
'exact'
],
30
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment