afeng commited on
Commit
b492457
Β·
1 Parent(s): 405302e

adding sliding bar

Browse files
Files changed (1) hide show
  1. app.py +20 -10
app.py CHANGED
@@ -315,7 +315,9 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
315
  tokenize_input = gr.Textbox(
316
  label="Input Text",
317
  placeholder="Enter text to tokenize...",
318
- lines=5
 
 
319
  )
320
  with gr.Column(scale=1):
321
  tokenize_model = gr.Dropdown(
@@ -335,17 +337,17 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
335
 
336
  with gr.Row():
337
  with gr.Column():
338
- tokens_output = gr.Textbox(label="Tokens", lines=10, max_lines=20)
339
  with gr.Column():
340
- token_ids_output = gr.Textbox(label="Token IDs", lines=10, max_lines=20)
341
 
342
  with gr.Row():
343
  with gr.Column():
344
- decoded_output = gr.Textbox(label="Decoded Text (Verification)", lines=5)
345
  with gr.Column():
346
- token_info_output = gr.Textbox(label="Detailed Token Information", lines=10, max_lines=20)
347
 
348
- stats_output = gr.Textbox(label="Statistics", lines=7)
349
 
350
  tokenize_btn.click(
351
  fn=tokenize_text,
@@ -359,7 +361,9 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
359
  decode_input = gr.Textbox(
360
  label="Token IDs",
361
  placeholder="Enter token IDs as a list [101, 2023, ...] or space/comma separated",
362
- lines=5
 
 
363
  )
364
  with gr.Column(scale=1):
365
  decode_model = gr.Dropdown(
@@ -377,9 +381,11 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
377
  decode_output = gr.Textbox(
378
  label="Decoded Text",
379
  lines=10,
 
380
  interactive=False,
381
  show_copy_button=True,
382
- placeholder="Decoded text will appear here..."
 
383
  )
384
 
385
  decode_stats = gr.Textbox(
@@ -392,8 +398,10 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
392
  decode_tokens_output = gr.Textbox(
393
  label="Tokens",
394
  lines=10,
 
395
  interactive=False,
396
- show_copy_button=True
 
397
  )
398
 
399
  decode_btn.click(
@@ -406,7 +414,9 @@ with gr.Blocks(title="πŸ€— Tokenizer Playground", theme=gr.themes.Soft()) as app
406
  compare_input = gr.Textbox(
407
  label="Input Text",
408
  placeholder="Enter text to compare tokenization across models...",
409
- lines=5
 
 
410
  )
411
 
412
  compare_models = gr.CheckboxGroup(
 
315
  tokenize_input = gr.Textbox(
316
  label="Input Text",
317
  placeholder="Enter text to tokenize...",
318
+ lines=5,
319
+ max_lines=15,
320
+ autoscroll=False
321
  )
322
  with gr.Column(scale=1):
323
  tokenize_model = gr.Dropdown(
 
337
 
338
  with gr.Row():
339
  with gr.Column():
340
+ tokens_output = gr.Textbox(label="Tokens", lines=10, max_lines=20, autoscroll=False, show_copy_button=True)
341
  with gr.Column():
342
+ token_ids_output = gr.Textbox(label="Token IDs", lines=10, max_lines=20, autoscroll=False, show_copy_button=True)
343
 
344
  with gr.Row():
345
  with gr.Column():
346
+ decoded_output = gr.Textbox(label="Decoded Text (Verification)", lines=5, max_lines=15, autoscroll=False, show_copy_button=True)
347
  with gr.Column():
348
+ token_info_output = gr.Textbox(label="Detailed Token Information", lines=10, max_lines=20, autoscroll=False, show_copy_button=True)
349
 
350
+ stats_output = gr.Textbox(label="Statistics", lines=7, max_lines=15, autoscroll=False)
351
 
352
  tokenize_btn.click(
353
  fn=tokenize_text,
 
361
  decode_input = gr.Textbox(
362
  label="Token IDs",
363
  placeholder="Enter token IDs as a list [101, 2023, ...] or space/comma separated",
364
+ lines=5,
365
+ max_lines=15,
366
+ autoscroll=False
367
  )
368
  with gr.Column(scale=1):
369
  decode_model = gr.Dropdown(
 
381
  decode_output = gr.Textbox(
382
  label="Decoded Text",
383
  lines=10,
384
+ max_lines=20,
385
  interactive=False,
386
  show_copy_button=True,
387
+ placeholder="Decoded text will appear here...",
388
+ autoscroll=False
389
  )
390
 
391
  decode_stats = gr.Textbox(
 
398
  decode_tokens_output = gr.Textbox(
399
  label="Tokens",
400
  lines=10,
401
+ max_lines=20,
402
  interactive=False,
403
+ show_copy_button=True,
404
+ autoscroll=False
405
  )
406
 
407
  decode_btn.click(
 
414
  compare_input = gr.Textbox(
415
  label="Input Text",
416
  placeholder="Enter text to compare tokenization across models...",
417
+ lines=5,
418
+ max_lines=15,
419
+ autoscroll=False
420
  )
421
 
422
  compare_models = gr.CheckboxGroup(