Spaces:
Sleeping
Sleeping
Update logger.py
Browse files
logger.py
CHANGED
@@ -3,10 +3,24 @@ import os
|
|
3 |
|
4 |
LOG_FILE = "feedback_log.csv"
|
5 |
|
6 |
-
def log_feedback(question, context,
|
7 |
file_exists = os.path.isfile(LOG_FILE)
|
8 |
with open(LOG_FILE, mode='a', newline='', encoding='utf-8') as file:
|
9 |
writer = csv.writer(file)
|
10 |
if not file_exists:
|
11 |
-
writer.writerow([
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
LOG_FILE = "feedback_log.csv"
|
5 |
|
6 |
+
def log_feedback(question, option1, option2, context, evo_output, evo_was_correct):
|
7 |
file_exists = os.path.isfile(LOG_FILE)
|
8 |
with open(LOG_FILE, mode='a', newline='', encoding='utf-8') as file:
|
9 |
writer = csv.writer(file)
|
10 |
if not file_exists:
|
11 |
+
writer.writerow([
|
12 |
+
"question",
|
13 |
+
"option1",
|
14 |
+
"option2",
|
15 |
+
"context",
|
16 |
+
"evo_output",
|
17 |
+
"evo_was_correct"
|
18 |
+
])
|
19 |
+
writer.writerow([
|
20 |
+
question,
|
21 |
+
option1,
|
22 |
+
option2,
|
23 |
+
context,
|
24 |
+
evo_output,
|
25 |
+
"yes" if evo_was_correct else "no"
|
26 |
+
])
|