Spaces:
Running
Running
update gradio to 4.38.1
Browse files- README.md +1 -1
- app.TabbedInterface.py +27 -0
- playground_app.py +3 -3
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: ⚔
|
|
4 |
colorFrom: red
|
5 |
colorTo: gray
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
datasets:
|
|
|
4 |
colorFrom: red
|
5 |
colorTo: gray
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.38.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
datasets:
|
app.TabbedInterface.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Gradio app to showcase the LLM tokenization.
|
2 |
+
|
3 |
+
"""
|
4 |
+
|
5 |
+
import os
|
6 |
+
from playground_app import demo as playground_tab
|
7 |
+
from compression_app import demo as compression_tab
|
8 |
+
from character_app import demo as character_tab
|
9 |
+
from patcher.gr_interface import TabbedInterface
|
10 |
+
from huggingface_hub import login
|
11 |
+
|
12 |
+
auth_token = os.environ.get('HF_TOKEN', None)
|
13 |
+
if auth_token:
|
14 |
+
login(token=auth_token)
|
15 |
+
|
16 |
+
# More Tab: encoding efficiency; decoding efficiency;
|
17 |
+
demo = TabbedInterface(
|
18 |
+
[playground_tab, compression_tab, character_tab],
|
19 |
+
[" ⚔️ Playground", "🏆 Compression Leaderboard", "📊 Character Statistics"],
|
20 |
+
title='<div align="center">Tokenizer Arena ⚔️</div>',
|
21 |
+
css="css/style.css"
|
22 |
+
)
|
23 |
+
|
24 |
+
demo.load(js=open("js/onload.js", "r", encoding="utf-8").read())
|
25 |
+
|
26 |
+
if __name__ == "__main__":
|
27 |
+
demo.queue(max_size=1024, default_concurrency_limit=80).launch()
|
playground_app.py
CHANGED
@@ -39,7 +39,7 @@ with gr.Blocks() as demo:
|
|
39 |
elem_classes="example-style"
|
40 |
)
|
41 |
user_input = gr.Textbox(
|
42 |
-
value=default_user_input,
|
43 |
label="Input Text",
|
44 |
lines=5,
|
45 |
show_label=False,
|
@@ -77,7 +77,7 @@ with gr.Blocks() as demo:
|
|
77 |
tokenizer_name_1 = gr.Dropdown(
|
78 |
all_tokenizer_name,
|
79 |
label="Tokenizer 1",
|
80 |
-
value=default_tokenizer_name_1,
|
81 |
)
|
82 |
with gr.Group():
|
83 |
with gr.Row():
|
@@ -121,7 +121,7 @@ with gr.Blocks() as demo:
|
|
121 |
tokenizer_name_2 = gr.Dropdown(
|
122 |
all_tokenizer_name,
|
123 |
label="Tokenizer 2",
|
124 |
-
value=default_tokenizer_name_2
|
125 |
)
|
126 |
with gr.Group():
|
127 |
with gr.Row():
|
|
|
39 |
elem_classes="example-style"
|
40 |
)
|
41 |
user_input = gr.Textbox(
|
42 |
+
# value=default_user_input,
|
43 |
label="Input Text",
|
44 |
lines=5,
|
45 |
show_label=False,
|
|
|
77 |
tokenizer_name_1 = gr.Dropdown(
|
78 |
all_tokenizer_name,
|
79 |
label="Tokenizer 1",
|
80 |
+
# value=default_tokenizer_name_1,
|
81 |
)
|
82 |
with gr.Group():
|
83 |
with gr.Row():
|
|
|
121 |
tokenizer_name_2 = gr.Dropdown(
|
122 |
all_tokenizer_name,
|
123 |
label="Tokenizer 2",
|
124 |
+
# value=default_tokenizer_name_2
|
125 |
)
|
126 |
with gr.Group():
|
127 |
with gr.Row():
|