"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "f4323dbf8c29952b1ae55b979120969a9aeb730e"
Commit fd8a3556 authored by Benjamin Mann's avatar Benjamin Mann
Browse files

fix run_gpt2.py

parent 94980b52
...@@ -83,7 +83,8 @@ def run_model(): ...@@ -83,7 +83,8 @@ def run_model():
elif args.length > model.config.n_ctx: elif args.length > model.config.n_ctx:
raise ValueError("Can't get samples longer than window size: %s" % 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: if not args.unconditional:
raw_text = input("Model prompt >>> ") raw_text = input("Model prompt >>> ")
while not raw_text: while not raw_text:
...@@ -106,6 +107,8 @@ def run_model(): ...@@ -106,6 +107,8 @@ def run_model():
print("=" * 40 + " SAMPLE " + str(generated) + " " + "=" * 40) print("=" * 40 + " SAMPLE " + str(generated) + " " + "=" * 40)
print(text) print(text)
print("=" * 80) print("=" * 80)
if args.unconditional:
break
if __name__ == '__main__': if __name__ == '__main__':
run_model() run_model()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment