Merge branch 'master' into master

This commit is contained in:
Thomas Wolf
2019-04-15 10:58:34 +02:00
committed by GitHub
8 changed files with 46 additions and 18 deletions

View File

@@ -83,8 +83,9 @@ 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)
if not args.unconditional:
while True:
while True:
context_tokens = []
if not args.unconditional:
raw_text = input("Model prompt >>> ")
while not raw_text:
print('Prompt should not be empty!')
@@ -123,6 +124,8 @@ def run_model():
print("=" * 40 + " SAMPLE " + str(generated) + " " + "=" * 40)
print(text)
print("=" * 80)
if args.unconditional:
break
if __name__ == '__main__':
run_model()