Suchinthana commited on
Commit
8d22a2e
·
1 Parent(s): 86f4b94

UI updates

Browse files
Files changed (1) hide show
  1. app.py +27 -17
app.py CHANGED
@@ -75,16 +75,19 @@ examples = {
75
  }
76
 
77
  with gr.Blocks() as demo:
78
- tokenizer_search_1 = HuggingfaceHubSearch(
79
- label="Search Huggingface Hub for Tokenizer 1",
80
- placeholder="Search for Tokenizer 1",
81
- search_type="model"
82
- )
83
- tokenizer_search_2 = HuggingfaceHubSearch(
84
- label="Search Huggingface Hub for Tokenizer 2",
85
- placeholder="Search for Tokenizer 2",
86
- search_type="model"
87
- )
 
 
 
88
 
89
  example_dropdown = gr.Dropdown(label="Select Example", choices=list(examples.keys()), value="Example 1")
90
  input_text = gr.Textbox(label="Input Text", lines=5)
@@ -92,13 +95,20 @@ with gr.Blocks() as demo:
92
  with gr.Accordion("Hugging Face Token (Optional)", open=False):
93
  hf_token = gr.Textbox(label="Hugging Face Token", placeholder="Enter HF token if needed for private tokenizers")
94
 
95
- tokenized_output_1 = gr.HTML(label="Tokenizer 1 - Tokenized Text")
96
- token_count_label_1 = gr.Label(label="Tokenizer 1 - Token Count and Word Count")
97
- utf8_output_1 = gr.HTML(label="Tokenizer 1 - UTF-8 Decoded Text")
98
-
99
- tokenized_output_2 = gr.HTML(label="Tokenizer 2 - Tokenized Text")
100
- token_count_label_2 = gr.Label(label="Tokenizer 2 - Token Count and Word Count")
101
- utf8_output_2 = gr.HTML(label="Tokenizer 2 - UTF-8 Decoded Text")
 
 
 
 
 
 
 
102
 
103
  example_dropdown.change(fn=lambda x: fill_example_text(examples[x]), inputs=example_dropdown, outputs=input_text)
104
 
 
75
  }
76
 
77
  with gr.Blocks() as demo:
78
+ with gr.Row():
79
+ with gr.Column():
80
+ tokenizer_search_1 = HuggingfaceHubSearch(
81
+ label="Search Huggingface Hub for Tokenizer 1",
82
+ placeholder="Search for Tokenizer 1",
83
+ search_type="model"
84
+ )
85
+ with gr.Column():
86
+ tokenizer_search_2 = HuggingfaceHubSearch(
87
+ label="Search Huggingface Hub for Tokenizer 2",
88
+ placeholder="Search for Tokenizer 2",
89
+ search_type="model"
90
+ )
91
 
92
  example_dropdown = gr.Dropdown(label="Select Example", choices=list(examples.keys()), value="Example 1")
93
  input_text = gr.Textbox(label="Input Text", lines=5)
 
95
  with gr.Accordion("Hugging Face Token (Optional)", open=False):
96
  hf_token = gr.Textbox(label="Hugging Face Token", placeholder="Enter HF token if needed for private tokenizers")
97
 
98
+ with gr.Row():
99
+ with gr.Column():
100
+ gr.Markdown("### Tokenizer 1 Outputs")
101
+ tokenized_output_1 = gr.HTML(label="Tokenizer 1 - Tokenized Text")
102
+ token_count_label_1 = gr.Label(label="Tokenizer 1 - Token Count and Word Count")
103
+ with gr.Accordion("Tokenizer 1 - UTF-8 Decoded Text", open=False):
104
+ utf8_output_1 = gr.HTML(label="Tokenizer 1 - UTF-8 Decoded Text")
105
+
106
+ with gr.Column():
107
+ gr.Markdown("### Tokenizer 2 Outputs")
108
+ tokenized_output_2 = gr.HTML(label="Tokenizer 2 - Tokenized Text")
109
+ token_count_label_2 = gr.Label(label="Tokenizer 2 - Token Count and Word Count")
110
+ with gr.Accordion("Tokenizer 2 - UTF-8 Decoded Text", open=False):
111
+ utf8_output_2 = gr.HTML(label="Tokenizer 2 - UTF-8 Decoded Text")
112
 
113
  example_dropdown.change(fn=lambda x: fill_example_text(examples[x]), inputs=example_dropdown, outputs=input_text)
114