ai-tomoni commited on
Commit
644bafc
·
verified ·
1 Parent(s): 6639133

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -10,14 +10,16 @@ import gradio as gr
10
  print(gr.__version__)
11
  from scenes import SCENES
12
 
13
- #from collect_feedback import collect_feedback
14
  from collect_feedback import collect_feedback, push_csv_to_space
15
 
16
- # 1. generate the CSV
17
- df = collect_feedback()
18
-
19
- # 2. commit it into the repo so it shows up in "Files and versions"
20
- push_csv_to_space()
 
 
 
21
 
22
 
23
 
 
10
  print(gr.__version__)
11
  from scenes import SCENES
12
 
 
13
  from collect_feedback import collect_feedback, push_csv_to_space
14
 
15
+ try:
16
+ df = collect_feedback() # pulls from dataset and writes all_logs.csv locally
17
+ if df is not None:
18
+ push_csv_to_space() # commits it into the Space repo so it appears next to app.py
19
+ else:
20
+ print("ℹ️ collect_feedback returned no data; skipping push.")
21
+ except Exception as e:
22
+ print("collect_feedback/push failed on startup:", e)
23
 
24
 
25