Spaces:
Sleeping
Sleeping
misdelivery
commited on
Commit
•
ce7a0ae
1
Parent(s):
a401019
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ scheduler = CommitScheduler(
|
|
32 |
def save_or_update_conversation(conversation_id, message, response, message_index, liked=None):
|
33 |
"""
|
34 |
Save or update conversation data in a JSON Lines file.
|
35 |
-
If the entry already exists (same id and message_index), update the '
|
36 |
Otherwise, append a new entry.
|
37 |
"""
|
38 |
with scheduler.lock:
|
@@ -47,7 +47,7 @@ def save_or_update_conversation(conversation_id, message, response, message_inde
|
|
47 |
|
48 |
if entry_index is not None:
|
49 |
# Update existing entry
|
50 |
-
data[entry_index]['
|
51 |
else:
|
52 |
# Append new entry
|
53 |
data.append({
|
|
|
32 |
def save_or_update_conversation(conversation_id, message, response, message_index, liked=None):
|
33 |
"""
|
34 |
Save or update conversation data in a JSON Lines file.
|
35 |
+
If the entry already exists (same id and message_index), update the 'label' field.
|
36 |
Otherwise, append a new entry.
|
37 |
"""
|
38 |
with scheduler.lock:
|
|
|
47 |
|
48 |
if entry_index is not None:
|
49 |
# Update existing entry
|
50 |
+
data[entry_index]['label'] = liked
|
51 |
else:
|
52 |
# Append new entry
|
53 |
data.append({
|