Unverified Commit 0d6a882f authored by dhanajitb's avatar dhanajitb Committed by GitHub
Browse files

Cleaned some redundant lines

```while not args.unconditional:
   if not args.unconditional:
```
These lines have been updated
parent 4d3721f9
...@@ -83,8 +83,8 @@ def run_model(): ...@@ -83,8 +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:
if not args.unconditional: if not args.unconditional:
while True:
raw_text = input("Model prompt >>> ") raw_text = input("Model prompt >>> ")
while not raw_text: while not raw_text:
print('Prompt should not be empty!') print('Prompt should not be empty!')
...@@ -94,8 +94,8 @@ def run_model(): ...@@ -94,8 +94,8 @@ def run_model():
for _ in range(args.nsamples // args.batch_size): for _ in range(args.nsamples // args.batch_size):
out = sample_sequence( out = sample_sequence(
model=model, length=args.length, model=model, length=args.length,
context=context_tokens if not args.unconditional else None, context=context_tokens,
start_token=enc.encoder['<|endoftext|>'] if args.unconditional else None, start_token=None,
batch_size=args.batch_size, batch_size=args.batch_size,
temperature=args.temperature, top_k=args.top_k, device=device temperature=args.temperature, top_k=args.top_k, device=device
) )
......
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