Rodiyah commited on
Commit
e1b2058
·
verified ·
1 Parent(s): 64f36cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -76,7 +76,13 @@ def download_logs():
76
  writer = csv.writer(output)
77
  writer.writerows(prediction_log)
78
  output.seek(0)
79
- return gr.File.update(value=io.BytesIO(output.getvalue().encode()), filename="prediction_logs.csv")
 
 
 
 
 
 
80
 
81
  # Build the UI with Gradio Blocks
82
  with gr.Blocks() as demo:
 
76
  writer = csv.writer(output)
77
  writer.writerows(prediction_log)
78
  output.seek(0)
79
+
80
+ # Save as a temporary file for download
81
+ with open("prediction_logs.csv", "w", newline="") as f:
82
+ f.write(output.getvalue())
83
+
84
+ return "prediction_logs.csv"
85
+
86
 
87
  # Build the UI with Gradio Blocks
88
  with gr.Blocks() as demo: