Rooni commited on
Commit
a1c8566
·
1 Parent(s): 9cb8f73

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -0
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # imports
2
+ from gradio import gr
3
+
4
+
5
+ # functions
6
+ def test(number, text):
7
+ return f'{number} - {text}'
8
+
9
+
10
+ # css
11
+ css = """
12
+ footer {visibility: hidden !important;}
13
+ """
14
+
15
+
16
+ # ui
17
+ with gr.Blocks(css=css) as vui:
18
+ with gr.Tabs() as tabs:
19
+ with gr.Tab("Вкладка 1", id='vkl1'):
20
+ with gr.Row():
21
+ with gr.Column(scale=3):
22
+ enter_one = gr.Textbox(placeholder="Ввод текста 1", show_label=False, lines=3)
23
+ with gr.Tab("Вкладка 2", id='vkl2'):
24
+ with gr.Row():
25
+ with gr.Column(scale=3):
26
+ with gr.Row():
27
+ with gr.Accordion(label="Выпадающий список", open=False):
28
+ num = gr.Radio(interactive=True, value="1", show_label=False, choices=[”1”, "2"])
29
+ with gr.Column():
30
+ vkl2_text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
31
+ with gr.Column(scale=2):
32
+ vkl2_text_output = gr.Textbox()
33
+
34
+ vkl2_text_button.click(test, inputs=[num, enter_one], outputs=vkl2_text_output)
35
+
36
+
37
+
38
+ #end
39
+ vui.queue(api_open=False).launch()