Spaces:
Sleeping
Sleeping
Download app.py from gui-sparim/BOXES: direct link, hf CLI and curl.
- Browser
- Download file 2.37 kB
-
https://huggingface.co/spaces/gui-sparim/BOXES/resolve/main/app.py
- Command line
-
hf download hf://spaces/gui-sparim/BOXES/app.py
-
curl -L -o app.py https://huggingface.co/spaces/gui-sparim/BOXES/resolve/main/app.py
2.37 kB
| import numpy as np | |
| import gradio as gr | |
| import boxes | |
| import boxes_2024 | |
| import boxes_2025 | |
| import boxes_2026 | |
| import convert | |
| bloco = gr.Blocks() | |
| with bloco: | |
| with gr.Tabs(): | |
| # Tab 2026 | |
| with gr.TabItem(boxes_2026.title): | |
| gr.Markdown(boxes_2026.description) | |
| inputs_26 = boxes_2026.load_inputs() | |
| btn_26 = gr.Button("Calcular") | |
| outputs_26 = [ | |
| gr.Textbox(lines=1, label="Valor do im贸vel (R$/m虏)"), | |
| gr.File(label="Download Relat贸rio em PDF") | |
| ] | |
| btn_26.click(boxes_2026.execute, inputs=inputs_26, outputs=outputs_26) | |
| # Tab 2025 | |
| with gr.TabItem(boxes_2025.title): | |
| gr.Markdown(boxes_2025.description) | |
| inputs_25 = boxes_2025.load_inputs() | |
| btn_25 = gr.Button("Calcular") | |
| outputs_25 = [ | |
| gr.Textbox(lines=1, label="Valor do im贸vel (R$/m虏)"), | |
| gr.File(label="Download Relat贸rio em PDF") | |
| ] | |
| btn_25.click(boxes_2025.execute, inputs=inputs_25, outputs=outputs_25) | |
| # Tab 2024 | |
| with gr.TabItem(boxes_2024.title): | |
| gr.Markdown(boxes_2024.description) | |
| inputs_24 = boxes_2024.load_inputs() | |
| btn_24 = gr.Button("Calcular") | |
| outputs_24 = [ | |
| gr.Textbox(lines=1, label="Valor do im贸vel (R$/m虏)"), | |
| gr.File(label="Download Relat贸rio em PDF") | |
| ] | |
| btn_24.click(boxes_2024.execute, inputs=inputs_24, outputs=outputs_24) | |
| # Tab Geral | |
| with gr.TabItem(boxes.title): | |
| gr.Markdown(boxes.description) | |
| inputs_boxes = boxes.load_inputs() | |
| btn_boxes = gr.Button("Calcular") | |
| outputs_boxes = gr.Textbox(lines=1, label=boxes.output_label) | |
| btn_boxes.click(boxes.execute, inputs=inputs_boxes, outputs=outputs_boxes) | |
| # Tab Conversor | |
| with gr.TabItem(convert.title): | |
| gr.Markdown(convert.description) | |
| inputs_conv = convert.load_inputs() | |
| btn_conv = gr.Button("Calcular") | |
| outputs_conv = gr.Textbox(lines=1, label=convert.output_label) | |
| btn_conv.click(convert.execute, inputs=inputs_conv, outputs=outputs_conv) | |
| # O segredo para o Spaces 茅 n茫o definir porta/host e desativar SSR | |
| bloco.launch() |