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
61674333
Unverified
Commit
61674333
authored
Apr 11, 2019
by
Thomas Wolf
Committed by
GitHub
Apr 11, 2019
Browse files
Merge pull request #462 from 8enmann/master
fix run_gpt2.py
parents
2cdfb8b2
fd8a3556
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
examples/run_gpt2.py
examples/run_gpt2.py
+4
-1
No files found.
examples/run_gpt2.py
View file @
61674333
...
...
@@ -83,7 +83,8 @@ def run_model():
elif
args
.
length
>
model
.
config
.
n_ctx
:
raise
ValueError
(
"Can't get samples longer than window size: %s"
%
model
.
config
.
n_ctx
)
while
not
args
.
unconditional
:
while
True
:
context_tokens
=
[]
if
not
args
.
unconditional
:
raw_text
=
input
(
"Model prompt >>> "
)
while
not
raw_text
:
...
...
@@ -106,6 +107,8 @@ def run_model():
print
(
"="
*
40
+
" SAMPLE "
+
str
(
generated
)
+
" "
+
"="
*
40
)
print
(
text
)
print
(
"="
*
80
)
if
args
.
unconditional
:
break
if
__name__
==
'__main__'
:
run_model
()
...
...
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