Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -328,7 +328,7 @@ def save_content_to_hf(vote_data, repo_name, folder_name, file_name):
|
|
| 328 |
)
|
| 329 |
|
| 330 |
|
| 331 |
-
def load_content_from_hf(repo_name="
|
| 332 |
"""
|
| 333 |
Read feedback content from a Hugging Face repository based on the current year.
|
| 334 |
|
|
@@ -389,7 +389,7 @@ def get_leaderboard_data(vote_entry=None):
|
|
| 389 |
)
|
| 390 |
|
| 391 |
# Load conversation data from the Hugging Face repository
|
| 392 |
-
conversation_data = load_content_from_hf("
|
| 393 |
conversation_df = pd.DataFrame(conversation_data)
|
| 394 |
|
| 395 |
# Merge vote data with conversation data
|
|
@@ -1196,7 +1196,7 @@ with gr.Blocks() as app:
|
|
| 1196 |
file_name = now.strftime("%Y%m%d_%H%M%S")
|
| 1197 |
|
| 1198 |
# Save feedback back to the Hugging Face dataset
|
| 1199 |
-
save_content_to_hf(vote_entry, "
|
| 1200 |
|
| 1201 |
conversation_state["right_chat"][0]["content"] = conversation_state[
|
| 1202 |
"right_chat"
|
|
@@ -1207,7 +1207,7 @@ with gr.Blocks() as app:
|
|
| 1207 |
|
| 1208 |
# Save conversations back to the Hugging Face dataset
|
| 1209 |
save_content_to_hf(
|
| 1210 |
-
conversation_state, "
|
| 1211 |
)
|
| 1212 |
|
| 1213 |
# Clear state
|
|
|
|
| 328 |
)
|
| 329 |
|
| 330 |
|
| 331 |
+
def load_content_from_hf(repo_name="SWE-Arena/model_votes"):
|
| 332 |
"""
|
| 333 |
Read feedback content from a Hugging Face repository based on the current year.
|
| 334 |
|
|
|
|
| 389 |
)
|
| 390 |
|
| 391 |
# Load conversation data from the Hugging Face repository
|
| 392 |
+
conversation_data = load_content_from_hf("SWE-Arena/model_conversations")
|
| 393 |
conversation_df = pd.DataFrame(conversation_data)
|
| 394 |
|
| 395 |
# Merge vote data with conversation data
|
|
|
|
| 1196 |
file_name = now.strftime("%Y%m%d_%H%M%S")
|
| 1197 |
|
| 1198 |
# Save feedback back to the Hugging Face dataset
|
| 1199 |
+
save_content_to_hf(vote_entry, "SWE-Arena/model_votes", folder_name, file_name)
|
| 1200 |
|
| 1201 |
conversation_state["right_chat"][0]["content"] = conversation_state[
|
| 1202 |
"right_chat"
|
|
|
|
| 1207 |
|
| 1208 |
# Save conversations back to the Hugging Face dataset
|
| 1209 |
save_content_to_hf(
|
| 1210 |
+
conversation_state, "SWE-Arena/model_conversations", folder_name, file_name
|
| 1211 |
)
|
| 1212 |
|
| 1213 |
# Clear state
|