Spaces:
Sleeping
Sleeping
hitchhiker3010
commited on
Update app.py
Browse files
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 = """
|