removing some redundant lines
This commit is contained in:
@@ -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():
|
|||||||
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
|
||||||
)
|
)
|
||||||
@@ -127,3 +127,4 @@ def run_model():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run_model()
|
run_model()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user