Gradio-Snippets / app.py
Nymbo's picture
adding MY UI KIT app.py file
4f9ea74 verified
raw
history blame
1.04 kB
# imports
import gradio as gr
# functions
def test(number, text):
return f'{number} - {text}'
# css
css = """
footer {visibility: hidden !important;}
"""
# ui
with gr.Blocks(css=css) as vui:
with gr.Tab("Вкладка 1", id='vkl1'):
with gr.Row():
with gr.Column(scale=3):
enter_one = gr.Textbox(placeholder="Ввод текста 1", show_label=False, lines=3)
with gr.Tab("Вкладка 2", id='vkl2'):
with gr.Row():
with gr.Column(scale=3):
with gr.Row():
with gr.Accordion(label="Выпадающий список", open=False):
num = gr.Radio(interactive=True, value="1", show_label=False, choices=["1", "2"])
vkl2_text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
vkl2_text_output = gr.Textbox()
vkl2_text_button.click(test, inputs=[num, enter_one], outputs=vkl2_text_output)
#end
vui.queue(api_open=False).launch()