yasserrmd commited on
Commit
4b51c4b
·
verified ·
1 Parent(s): f6b3246

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -16,7 +16,14 @@ MASK_TOKEN = "[MASK]"
16
 
17
  vocab = {PAD_TOKEN: 0, MASK_TOKEN: 1}
18
 
19
- # Assume vocab, id_to_word, pad_id, mask_id already defined
 
 
 
 
 
 
 
20
 
21
  # =====================
22
  # Generation Function
 
16
 
17
  vocab = {PAD_TOKEN: 0, MASK_TOKEN: 1}
18
 
19
+ # Reverse mapping
20
+ id_to_word = {i: w for w, i in vocab.items()}
21
+
22
+ # Special token IDs
23
+ pad_id = vocab[PAD_TOKEN]
24
+ mask_id = vocab[MASK_TOKEN]
25
+
26
+
27
 
28
  # =====================
29
  # Generation Function