histlearn commited on
Commit
77049fb
·
verified ·
1 Parent(s): 4dab376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -69
app.py CHANGED
@@ -639,80 +639,80 @@ class ReportGenerator:
639
  logging.error(f"Erro no processamento: {str(e)}")
640
  raise
641
 
642
- def create_interface():
643
- """Cria a interface Gradio."""
644
- theme = gr.themes.Default(
645
- primary_hue="blue",
646
- secondary_hue="gray",
647
- font=["Arial", "sans-serif"],
648
- font_mono=["Courier New", "monospace"],
649
- )
650
-
651
- with gr.Blocks(theme=theme) as interface:
652
- gr.Markdown("""
653
- # Sistema de Análise de Desempenho Acadêmico
654
 
655
- Este sistema analisa o desempenho dos alunos e gera um relatório detalhado com:
656
- - Análise estatística completa
657
- - Visualizações gráficas
658
- - Recomendações personalizadas
659
- """)
660
 
661
- with gr.Row():
662
- with gr.Column():
663
- gr.Markdown("## Lista de Alunos")
664
- html_file = gr.File(
665
- label="Arquivo HTML com lista de alunos (.htm)",
666
- type="binary",
667
- file_types=[".htm", ".html"]
668
- )
669
 
670
- with gr.Column():
671
- gr.Markdown("## Relatórios de Tarefas")
672
- excel_files = gr.Files(
673
- label="Arquivos Excel com dados das tarefas (.xlsx)",
674
- type="binary",
675
- file_count="multiple",
676
- file_types=[".xlsx"]
 
 
 
 
 
 
 
677
  )
678
-
679
- with gr.Row():
680
- generate_btn = gr.Button(
681
- "Gerar Relatório",
682
- variant="primary",
683
- size="lg"
684
- )
685
 
686
- with gr.Row():
687
- output_html = gr.HTML()
688
 
689
- with gr.Row():
690
- with gr.Column():
691
- download_html_btn = gr.File(
692
- label="Download Relatório HTML",
693
- type="filepath",
694
- interactive=False
695
- )
696
- with gr.Column():
697
- download_pdf_btn = gr.File(
698
- label="Download Relatório PDF",
699
- type="filepath",
700
- interactive=False
701
- )
702
-
703
- generate_btn.click(
704
- fn=process_files,
705
- inputs=[html_file, excel_files],
706
- outputs=[output_html, download_html_btn, download_pdf_btn]
707
- )
708
 
709
- return interface
710
 
711
- if __name__ == "__main__":
712
- interface = create_interface()
713
- interface.launch(
714
- share=False,
715
- server_name="0.0.0.0",
716
- server_port=7860,
717
- show_error=True
718
- )
 
639
  logging.error(f"Erro no processamento: {str(e)}")
640
  raise
641
 
642
+ def create_interface():
643
+ """Cria a interface Gradio."""
644
+ theme = gr.themes.Default(
645
+ primary_hue="blue",
646
+ secondary_hue="gray",
647
+ font=["Arial", "sans-serif"],
648
+ font_mono=["Courier New", "monospace"],
649
+ )
650
+
651
+ with gr.Blocks(theme=theme) as interface:
652
+ gr.Markdown("""
653
+ # Sistema de Análise de Desempenho Acadêmico
654
 
655
+ Este sistema analisa o desempenho dos alunos e gera um relatório detalhado com:
656
+ - Análise estatística completa
657
+ - Visualizações gráficas
658
+ - Recomendações personalizadas
659
+ """)
660
 
661
+ with gr.Row():
662
+ with gr.Column():
663
+ gr.Markdown("## Lista de Alunos")
664
+ html_file = gr.File(
665
+ label="Arquivo HTML com lista de alunos (.htm)",
666
+ type="binary",
667
+ file_types=[".htm", ".html"]
668
+ )
669
 
670
+ with gr.Column():
671
+ gr.Markdown("## Relatórios de Tarefas")
672
+ excel_files = gr.Files(
673
+ label="Arquivos Excel com dados das tarefas (.xlsx)",
674
+ type="binary",
675
+ file_count="multiple",
676
+ file_types=[".xlsx"]
677
+ )
678
+
679
+ with gr.Row():
680
+ generate_btn = gr.Button(
681
+ "Gerar Relatório",
682
+ variant="primary",
683
+ size="lg"
684
  )
 
 
 
 
 
 
 
685
 
686
+ with gr.Row():
687
+ output_html = gr.HTML()
688
 
689
+ with gr.Row():
690
+ with gr.Column():
691
+ download_html_btn = gr.File(
692
+ label="Download Relatório HTML",
693
+ type="filepath",
694
+ interactive=False
695
+ )
696
+ with gr.Column():
697
+ download_pdf_btn = gr.File(
698
+ label="Download Relatório PDF",
699
+ type="filepath",
700
+ interactive=False
701
+ )
702
+
703
+ generate_btn.click(
704
+ fn=process_files,
705
+ inputs=[html_file, excel_files],
706
+ outputs=[output_html, download_html_btn, download_pdf_btn]
707
+ )
708
 
709
+ return interface
710
 
711
+ if __name__ == "__main__":
712
+ interface = create_interface()
713
+ interface.launch(
714
+ share=False,
715
+ server_name="0.0.0.0",
716
+ server_port=7860,
717
+ show_error=True
718
+ )