Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -172,11 +172,71 @@ def process_files(html_file, excel_files) -> Tuple[str, str, str]:
|
|
| 172 |
return "Relat贸rio gerado"
|
| 173 |
|
| 174 |
# Interface Gradio
|
| 175 |
-
theme = gr.themes.Default(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
with gr.Blocks(theme=theme) as interface:
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
if __name__ == "__main__":
|
| 182 |
-
interface.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
return "Relat贸rio gerado"
|
| 173 |
|
| 174 |
# Interface Gradio
|
| 175 |
+
theme = gr.themes.Default(
|
| 176 |
+
primary_hue="blue",
|
| 177 |
+
secondary_hue="gray",
|
| 178 |
+
font=["Arial", "sans-serif"],
|
| 179 |
+
font_mono=["Courier New", "monospace"],
|
| 180 |
+
)
|
| 181 |
|
| 182 |
with gr.Blocks(theme=theme) as interface:
|
| 183 |
+
gr.Markdown("""
|
| 184 |
+
# Sistema de An谩lise de Desempenho Acad锚mico
|
| 185 |
+
|
| 186 |
+
Este sistema analisa o desempenho dos alunos e gera um relat贸rio detalhado com:
|
| 187 |
+
- An谩lise estat铆stica completa
|
| 188 |
+
- Visualiza莽玫es gr谩ficas
|
| 189 |
+
- Recomenda莽玫es personalizadas
|
| 190 |
+
""")
|
| 191 |
+
|
| 192 |
+
with gr.Row():
|
| 193 |
+
with gr.Column():
|
| 194 |
+
gr.Markdown("## Lista de Alunos")
|
| 195 |
+
html_file = gr.File(
|
| 196 |
+
label="Arquivo HTML com lista de alunos (.htm)",
|
| 197 |
+
type="binary",
|
| 198 |
+
file_types=[".htm", ".html"]
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
with gr.Column():
|
| 202 |
+
gr.Markdown("## Relat贸rios de Tarefas")
|
| 203 |
+
excel_files = gr.Files(
|
| 204 |
+
label="Arquivos Excel com dados das tarefas (.xlsx)",
|
| 205 |
+
type="binary",
|
| 206 |
+
file_count="multiple",
|
| 207 |
+
file_types=[".xlsx"]
|
| 208 |
+
)
|
| 209 |
+
|
| 210 |
+
with gr.Row():
|
| 211 |
+
generate_btn = gr.Button("Gerar Relat贸rio", variant="primary", size="lg")
|
| 212 |
+
|
| 213 |
+
with gr.Row():
|
| 214 |
+
output_html = gr.HTML()
|
| 215 |
+
|
| 216 |
+
with gr.Row():
|
| 217 |
+
with gr.Column():
|
| 218 |
+
download_html_btn = gr.File(
|
| 219 |
+
label="Download Relat贸rio HTML",
|
| 220 |
+
type="filepath",
|
| 221 |
+
interactive=False
|
| 222 |
+
)
|
| 223 |
+
with gr.Column():
|
| 224 |
+
download_pdf_btn = gr.File(
|
| 225 |
+
label="Download Relat贸rio PDF",
|
| 226 |
+
type="filepath",
|
| 227 |
+
interactive=False
|
| 228 |
+
)
|
| 229 |
+
|
| 230 |
+
generate_btn.click(
|
| 231 |
+
fn=process_files,
|
| 232 |
+
inputs=[html_file, excel_files],
|
| 233 |
+
outputs=[output_html, download_html_btn, download_pdf_btn]
|
| 234 |
+
)
|
| 235 |
|
| 236 |
if __name__ == "__main__":
|
| 237 |
+
interface.launch(
|
| 238 |
+
share=False,
|
| 239 |
+
server_name="0.0.0.0",
|
| 240 |
+
server_port=7860,
|
| 241 |
+
show_error=True
|
| 242 |
+
)
|