Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ llama_tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/llama-token
|
|
8 |
falcon_tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b")
|
9 |
phi2_tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
|
10 |
t5_tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-xxl")
|
|
|
11 |
|
12 |
def tokenize(input_text):
|
13 |
gpt2_tokens = gpt2_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
@@ -16,8 +17,9 @@ def tokenize(input_text):
|
|
16 |
falcon_tokens = falcon_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
17 |
phi2_tokens = phi2_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
18 |
t5_tokens = t5_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
|
|
19 |
|
20 |
-
return f"GPT-2/GPT-J: {len(gpt2_tokens)}\nGPT-NeoX: {len(gpt_neox_tokens)}\nLLaMa: {len(llama_tokens)}\nFalcon: {len(falcon_tokens)}\nPhi-2: {len(phi2_tokens)}\nT5: {len(t5_tokens)}"
|
21 |
|
22 |
iface = gr.Interface(fn=tokenize, inputs=gr.Textbox(lines=7), outputs="text")
|
23 |
iface.launch()
|
|
|
8 |
falcon_tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b")
|
9 |
phi2_tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
|
10 |
t5_tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-xxl")
|
11 |
+
mistral_tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
|
12 |
|
13 |
def tokenize(input_text):
|
14 |
gpt2_tokens = gpt2_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
|
|
17 |
falcon_tokens = falcon_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
18 |
phi2_tokens = phi2_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
19 |
t5_tokens = t5_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
20 |
+
mistral_tokens = mistral_tokenizer(input_text, add_special_tokens=True)["input_ids"]
|
21 |
|
22 |
+
return f"GPT-2/GPT-J: {len(gpt2_tokens)}\nGPT-NeoX: {len(gpt_neox_tokens)}\nLLaMa: {len(llama_tokens)}\nFalcon: {len(falcon_tokens)}\nPhi-2: {len(phi2_tokens)}\nT5: {len(t5_tokens)}\nMistral: {len(mistral_tokens)}"
|
23 |
|
24 |
iface = gr.Interface(fn=tokenize, inputs=gr.Textbox(lines=7), outputs="text")
|
25 |
iface.launch()
|