tab1_to_tab2 / app.py
fschwartzer's picture
Update app.py
09e090c
import numpy as np
import gradio as gr
import tab1
import tab2
theme = gr.themes.Soft(
primary_hue="emerald",
secondary_hue="green",
neutral_hue="neutral",
font=[gr.themes.GoogleFont('Arial'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
).set(
body_background_fill='*neutral_200',
body_text_color_dark='*neutral_50',
body_text_color_subdued='*neutral_600',
button_shadow='*button_shadow_active'
)
bloco = gr.Blocks(theme=theme)
with bloco:
with gr.Tabs():
with gr.TabItem(tab1.title):
gr.Markdown(tab1.description)
inputs = tab1.load_inputs()
text_button = gr.Button("Executar")
outputs = gr.TextArea(lines=1, label=tab1.output_label)
text_button.click(tab1.execute, inputs=inputs, outputs=gr.File())
with gr.TabItem(tab2.title):
gr.Markdown(tab2.description)
inputs = tab2.load_inputs()
text_button = gr.Button("Executar")
outputs = gr.TextArea(lines=1, label=tab2.output_label)
text_button.click(tab2.execute, inputs=inputs, outputs=[gr.Text(), gr.Image()])
bloco.launch()