Slait commited on
Commit
4368e73
·
verified ·
1 Parent(s): ddab690

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -505,7 +505,8 @@ def create_interface():
505
  [get_text("example_4")]
506
  ],
507
  inputs=[single_prompt],
508
- label=""
 
509
  )
510
 
511
  # Вкладка пакетной обработки
@@ -533,15 +534,6 @@ def create_interface():
533
  show_copy_button=True
534
  )
535
 
536
- # Примеры использования
537
- examples_md = gr.Markdown(f"""
538
- ### {get_text("examples_title")}
539
- - "{get_text("example_1")}"
540
- - "{get_text("example_2")}"
541
- - "{get_text("example_3")}"
542
- - "{get_text("example_4")}"
543
- """)
544
-
545
  # Обработчики событий
546
  def change_language(lang):
547
  global current_language
@@ -568,18 +560,19 @@ def create_interface():
568
  gr.update(label=get_text("prompt"), placeholder=get_text("prompt_placeholder")), # single_prompt
569
  gr.update(value=get_text("generate_btn")), # single_submit_btn
570
  gr.update(label=get_text("result")), # single_output
 
 
 
 
 
 
 
 
571
  gr.update(label=get_text("batch_processing")), # batch_tab
572
  gr.update(label=get_text("upload_images")), # batch_images
573
  gr.update(label=get_text("prompts_multiline"), placeholder=get_text("prompts_placeholder"), info=get_text("prompts_info")), # batch_prompts
574
  gr.update(value=get_text("process_batch_btn")), # batch_submit_btn
575
  gr.update(label=get_text("results")), # batch_output
576
- f"""
577
- ### {get_text("examples_title")}
578
- - "{get_text("example_1")}"
579
- - "{get_text("example_2")}"
580
- - "{get_text("example_3")}"
581
- - "{get_text("example_4")}"
582
- """ # examples_md
583
  ]
584
 
585
  language_dropdown.change(
@@ -601,12 +594,12 @@ def create_interface():
601
  single_prompt,
602
  single_submit_btn,
603
  single_output,
 
604
  batch_tab,
605
  batch_images,
606
  batch_prompts,
607
  batch_submit_btn,
608
  batch_output,
609
- examples_md
610
  ]
611
  )
612
 
 
505
  [get_text("example_4")]
506
  ],
507
  inputs=[single_prompt],
508
+ label="",
509
+ examples_per_page=4
510
  )
511
 
512
  # Вкладка пакетной обработки
 
534
  show_copy_button=True
535
  )
536
 
 
 
 
 
 
 
 
 
 
537
  # Обработчики событий
538
  def change_language(lang):
539
  global current_language
 
560
  gr.update(label=get_text("prompt"), placeholder=get_text("prompt_placeholder")), # single_prompt
561
  gr.update(value=get_text("generate_btn")), # single_submit_btn
562
  gr.update(label=get_text("result")), # single_output
563
+ gr.update(
564
+ examples=[
565
+ [get_text("example_1")],
566
+ [get_text("example_2")],
567
+ [get_text("example_3")],
568
+ [get_text("example_4")]
569
+ ]
570
+ ), # single_examples
571
  gr.update(label=get_text("batch_processing")), # batch_tab
572
  gr.update(label=get_text("upload_images")), # batch_images
573
  gr.update(label=get_text("prompts_multiline"), placeholder=get_text("prompts_placeholder"), info=get_text("prompts_info")), # batch_prompts
574
  gr.update(value=get_text("process_batch_btn")), # batch_submit_btn
575
  gr.update(label=get_text("results")), # batch_output
 
 
 
 
 
 
 
576
  ]
577
 
578
  language_dropdown.change(
 
594
  single_prompt,
595
  single_submit_btn,
596
  single_output,
597
+ single_examples,
598
  batch_tab,
599
  batch_images,
600
  batch_prompts,
601
  batch_submit_btn,
602
  batch_output,
 
603
  ]
604
  )
605