adamcasson commited on
Commit
18c03c5
·
1 Parent(s): a891744

fix spacing

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -153,12 +153,12 @@ def mask_viz(denoiser, text):
153
  highlight_enc = []
154
  enc_tok = tokenizer.convert_ids_to_tokens(enc_in)
155
  for id, tok, tok_mask in zip(enc_in, enc_tok, enc_mask):
156
- highlight_enc.append((tok.replace("Ġ", " ").replace("Ċ", "\n") if tok_mask == 1 else str(id), "masked" if tok_mask == 0 else "unmasked"))
157
 
158
  highlight_dec = []
159
  dec_tok = tokenizer.convert_ids_to_tokens(dec_in)
160
  for id, tok, tok_mask in zip(dec_in, dec_tok, dec_mask):
161
- highlight_dec.append((tok.replace("Ġ", " ").replace("Ċ", "\n") if tok_mask == 1 else str(id), "masked" if tok_mask == 0 else "unmasked"))
162
 
163
  return highlight_tok, highlight_enc, highlight_dec
164
 
 
153
  highlight_enc = []
154
  enc_tok = tokenizer.convert_ids_to_tokens(enc_in)
155
  for id, tok, tok_mask in zip(enc_in, enc_tok, enc_mask):
156
+ highlight_enc.append((tok.replace("Ġ", " ").replace("Ċ", "\n") if tok_mask == 1 else f" {id}", "masked" if tok_mask == 0 else "unmasked"))
157
 
158
  highlight_dec = []
159
  dec_tok = tokenizer.convert_ids_to_tokens(dec_in)
160
  for id, tok, tok_mask in zip(dec_in, dec_tok, dec_mask):
161
+ highlight_dec.append((tok.replace("Ġ", " ").replace("Ċ", "\n") if tok_mask == 1 else f" {id}", "masked" if tok_mask == 0 else "unmasked"))
162
 
163
  return highlight_tok, highlight_enc, highlight_dec
164