Spaces:
Runtime error
Runtime error
Update logger.py
Browse files
logger.py
CHANGED
@@ -11,13 +11,15 @@ if not firebase_admin._apps:
|
|
11 |
db = firestore.client()
|
12 |
|
13 |
def log_user_feedback(goal, sol1, sol2, winner):
|
14 |
-
formatted_winner = "1" if "1" in winner else "2"
|
15 |
|
16 |
doc = {
|
17 |
"timestamp": datetime.utcnow().isoformat(),
|
18 |
-
"
|
19 |
-
"
|
|
|
|
|
|
|
20 |
}
|
21 |
-
|
22 |
db.collection("evo_feedback").add(doc)
|
23 |
-
print(f"π₯ Logged feedback
|
|
|
11 |
db = firestore.client()
|
12 |
|
13 |
def log_user_feedback(goal, sol1, sol2, winner):
|
14 |
+
formatted_winner = "1" if "1" in winner else "2" # Critical fix
|
15 |
|
16 |
doc = {
|
17 |
"timestamp": datetime.utcnow().isoformat(),
|
18 |
+
"goal": goal,
|
19 |
+
"solution_1": sol1,
|
20 |
+
"solution_2": sol2,
|
21 |
+
"winner": formatted_winner, # β
Needed by training and plots
|
22 |
+
"user_feedback": "from app.py"
|
23 |
}
|
|
|
24 |
db.collection("evo_feedback").add(doc)
|
25 |
+
print(f"π₯ Logged feedback: Solution {formatted_winner}")
|