Spaces:
Sleeping
Sleeping
File size: 1,311 Bytes
bf93a7c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# imports
import gradio as gr
# functions
def test(number, text):
return f'{number} - {text}'
# css
css = """
body {background-color: transparent !important;}
footer {visibility: hidden !important;}
"""
# ui
with gr.Blocks(css=css) as vui:
with gr.Tabs() as tabs:
with gr.Row():
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"])
with gr.Column():
vkl2_text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
with gr.Column(scale=2):
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() |