javirandor commited on
Commit
6bdb0dc
1 Parent(s): e614e62

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -14
README.md CHANGED
@@ -50,20 +50,19 @@ model = GPT2LMHeadModel.from_pretrained("javirandor/passgpt-10characters").eval(
50
 
51
  NUM_GENERATIONS = 1
52
 
53
- with torch.no_grad():
54
- # Generate passwords sampling from the beginning of password token
55
- g = model.generate(torch.tensor([[tokenizer.bos_token_id]]).cuda(),
56
- do_sample=True,
57
- num_return_sequences=NUM_GENERATIONS,
58
- max_length=12,
59
- pad_token_id=tokenizer.pad_token_id,
60
- bad_words_ids=[[tokenizer.bos_token_id]])
61
-
62
- # Remove start of sentence token
63
- g = g[:, 1:]
64
-
65
- decoded = tokenizer.batch_decode(g.tolist())
66
- decoded_clean = [i.split("</s>")[0] for i in decoded] # Get content before end of password token
67
 
68
  # Print your sampled passwords!
69
  print(decoded_clean)
 
50
 
51
  NUM_GENERATIONS = 1
52
 
53
+ # Generate passwords sampling from the beginning of password token
54
+ g = model.generate(torch.tensor([[tokenizer.bos_token_id]]).cuda(),
55
+ do_sample=True,
56
+ num_return_sequences=NUM_GENERATIONS,
57
+ max_length=12,
58
+ pad_token_id=tokenizer.pad_token_id,
59
+ bad_words_ids=[[tokenizer.bos_token_id]])
60
+
61
+ # Remove start of sentence token
62
+ g = g[:, 1:]
63
+
64
+ decoded = tokenizer.batch_decode(g.tolist())
65
+ decoded_clean = [i.split("</s>")[0] for i in decoded] # Get content before end of password token
 
66
 
67
  # Print your sampled passwords!
68
  print(decoded_clean)