Spaces:
Sleeping
Sleeping
| # 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() |