Spaces:
Sleeping
Sleeping
Update logger.py
Browse files
logger.py
CHANGED
@@ -15,10 +15,10 @@ def log_feedback(
|
|
15 |
user_preference=None
|
16 |
):
|
17 |
"""
|
18 |
-
Logs Evo and GPT output for
|
19 |
"""
|
20 |
file_exists = os.path.isfile(LOG_FILE)
|
21 |
-
|
22 |
with open(LOG_FILE, mode='a', newline='', encoding='utf-8') as file:
|
23 |
writer = csv.writer(file)
|
24 |
|
@@ -32,9 +32,14 @@ def log_feedback(
|
|
32 |
"evo_output",
|
33 |
"gpt_output",
|
34 |
"evo_reasoning",
|
35 |
-
"user_preference"
|
|
|
36 |
])
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
writer.writerow([
|
39 |
datetime.now().isoformat(),
|
40 |
question,
|
@@ -44,5 +49,6 @@ def log_feedback(
|
|
44 |
evo_output,
|
45 |
gpt_output,
|
46 |
evo_reasoning,
|
47 |
-
user_preference or ""
|
|
|
48 |
])
|
|
|
15 |
user_preference=None
|
16 |
):
|
17 |
"""
|
18 |
+
Logs Evo and GPT output along with user's preference for retraining.
|
19 |
"""
|
20 |
file_exists = os.path.isfile(LOG_FILE)
|
21 |
+
|
22 |
with open(LOG_FILE, mode='a', newline='', encoding='utf-8') as file:
|
23 |
writer = csv.writer(file)
|
24 |
|
|
|
32 |
"evo_output",
|
33 |
"gpt_output",
|
34 |
"evo_reasoning",
|
35 |
+
"user_preference",
|
36 |
+
"evo_was_correct"
|
37 |
])
|
38 |
+
|
39 |
+
evo_was_correct = "yes" if user_preference == "Evo" else (
|
40 |
+
"no" if user_preference == "GPT" else ""
|
41 |
+
)
|
42 |
+
|
43 |
writer.writerow([
|
44 |
datetime.now().isoformat(),
|
45 |
question,
|
|
|
49 |
evo_output,
|
50 |
gpt_output,
|
51 |
evo_reasoning,
|
52 |
+
user_preference or "",
|
53 |
+
evo_was_correct
|
54 |
])
|