Capebm commited on
Commit
06fe75a
·
verified ·
1 Parent(s): 98ae1ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -3,6 +3,8 @@ import numpy as np
3
  import gradio as gr
4
  from sklearn.ensemble import RandomForestRegressor
5
  from sklearn.model_selection import train_test_split
 
 
6
 
7
  # Load the dataset
8
  file_path = 'Volumes_processed.xlsx' # This file should be uploaded to the Hugging Face Space
@@ -94,17 +96,17 @@ body {
94
  with gr.Blocks(css=css) as iface:
95
  gr.Markdown("## BCTT: Prever Processos com Random Forest")
96
 
97
- with gr.Tab("Previsão"):
98
- month = gr.Dropdown(choices=list(month_map_reverse.values()), value=default_month_name, label="Mês de Inicio da Previsão")
99
- process = gr.CheckboxGroup(choices=default_processes, value=default_processes, label="Processos")
100
- n_months = gr.Slider(minimum=1, maximum=12, step=1, value=9, label="Número de Meses a Prever")
101
-
102
- output = gr.DataFrame()
103
-
104
- btn = gr.Button("Prever")
105
- btn.click(forecast_interface, inputs=[month, process, n_months], outputs=output)
106
-
107
- with gr.Tab("Dados de Entrada"):
108
- input_data = gr.DataFrame(value=display_input_data())
109
 
 
 
 
 
 
 
 
 
 
110
  iface.launch()
 
3
  import gradio as gr
4
  from sklearn.ensemble import RandomForestRegressor
5
  from sklearn.model_selection import train_test_split
6
+ import webbrowser
7
+ import threading
8
 
9
  # Load the dataset
10
  file_path = 'Volumes_processed.xlsx' # This file should be uploaded to the Hugging Face Space
 
96
  with gr.Blocks(css=css) as iface:
97
  gr.Markdown("## BCTT: Prever Processos com Random Forest")
98
 
99
+ month = gr.Dropdown(choices=list(month_map_reverse.values()), value=default_month_name, label="Mês de Inicio da Previsão")
100
+ process = gr.CheckboxGroup(choices=default_processes, value=default_processes, label="Processos")
101
+ n_months = gr.Slider(minimum=1, maximum=12, step=1, value=9, label="Número de Meses a Prever")
 
 
 
 
 
 
 
 
 
102
 
103
+ output = gr.DataFrame()
104
+ input_data_display = gr.DataFrame(value=display_input_data())
105
+
106
+ btn = gr.Button("Prever")
107
+ btn.click(forecast_interface, inputs=[month, process, n_months], outputs=output)
108
+
109
+ gr.Markdown("### Dados de Entrada")
110
+ gr.DataFrame(data)
111
+
112
  iface.launch()