hitchhiker3010 commited on
Commit
30231a5
·
verified ·
1 Parent(s): d2883dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -8,7 +8,7 @@ def token_viz(model_name, text):
8
  tokenizer = AutoTokenizer.from_pretrained(model_name,cache_dir=f"./.cache/hf/{model_name}")
9
  print(model_name,text)
10
  tokens = tokenizer.encode(text)
11
- return [(tokenizer.decode(token).replace("\n",r"\n"), str(token)) for token in tokens]
12
 
13
 
14
  MARKDOWN = """
 
8
  tokenizer = AutoTokenizer.from_pretrained(model_name,cache_dir=f"./.cache/hf/{model_name}")
9
  print(model_name,text)
10
  tokens = tokenizer.encode(text)
11
+ return [(tokenizer.decode(token).replace("\n",r"\n"), str(token)) for token in tokens] # Replacing '\n' for visualization purposes
12
 
13
 
14
  MARKDOWN = """