joaomaia commited on
Commit
ce39427
·
verified ·
1 Parent(s): 3afd837

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -31,13 +31,16 @@ def predict_tiebreak(df):
31
  def predict_from_excel(file):
32
  df = pd.read_excel(file)
33
  df_predictions = predict_tiebreak(df)
 
 
34
  output_file = "predictions.xlsx"
35
  df_predictions.to_excel(output_file, index=False)
36
- return output_file
 
37
 
38
  # Interface Gradio usando a nova API de componentes
39
  inputs = gr.File(label="Upload Excel File")
40
- outputs = gr.File(label="Download Predictions Excel")
41
 
42
  # Criando a interface
43
  gr.Interface(
 
31
  def predict_from_excel(file):
32
  df = pd.read_excel(file)
33
  df_predictions = predict_tiebreak(df)
34
+
35
+ # Salvar o DataFrame resultante em um arquivo Excel
36
  output_file = "predictions.xlsx"
37
  df_predictions.to_excel(output_file, index=False)
38
+
39
+ return df_predictions, output_file
40
 
41
  # Interface Gradio usando a nova API de componentes
42
  inputs = gr.File(label="Upload Excel File")
43
+ outputs = [gr.DataFrame(label="Tabela de Previsões"), gr.File(label="Download Predictions Excel")]
44
 
45
  # Criando a interface
46
  gr.Interface(