d5a75ba09ae0595ca284fd806475eb8d3f771387,word_language_model/generate.py,,,#,18
Before Change
word = corpus.dic.idx2word[gen]
outf.write(word)
if i % 20 == 19:
outf.write("\n")
else:
outf.write(" ")
if i % args.reportinterval == 0:
print("| Generated {}/{} words".format(i, args.nwords))
After Change
// Set the random seed manually for reproducibility.
torch.manual_seed(args.seed)
if torch.cuda.is_available():
if not args.cuda:
print("WARNING: You have a CUDA device, so you should probably run with --cuda")
else:
torch.cuda.manual_seed(args.seed)
if args.temperature < 1e-3:
parser.error("--temperature has to be greater or equal 1e-3")
with open(args.checkpoint, "rb") as f:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: pytorch/examples
Commit Name: d5a75ba09ae0595ca284fd806475eb8d3f771387
Time: 2017-01-17
Author: adam.paszke@gmail.com
File Name: word_language_model/generate.py
Class Name:
Method Name:
Project Name: pytorch/fairseq
Commit Name: 28876638114948711fd4bd4e350fdd6809013f1e
Time: 2020-07-08
Author: mari.fomicheva@gmail.com
File Name: fairseq_cli/interactive.py
Class Name:
Method Name: main