Spaces:
Running
Running
Refactor conversation deletion docstrings: Improve clarity and formatting of docstrings for delete_conversation_from_huggingface and delete_conversation functions.
Browse files
app.py
CHANGED
|
@@ -803,15 +803,15 @@ def save_system_prompt(prompt_text):
|
|
| 803 |
return f"Error saving prompt: {str(e)}"
|
| 804 |
|
| 805 |
def delete_conversation_from_huggingface(conversation_id):
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
try:
|
| 816 |
from huggingface_hub import HfApi, hf_hub_download
|
| 817 |
from huggingface_hub.utils import RepositoryNotFoundError, RevisionNotFoundError
|
|
@@ -879,16 +879,16 @@ def save_system_prompt(prompt_text):
|
|
| 879 |
|
| 880 |
|
| 881 |
def delete_conversation(conversation_id, evaluator):
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
try:
|
| 893 |
if not conversation_id:
|
| 894 |
return "Error: No conversation ID provided"
|
|
|
|
| 803 |
return f"Error saving prompt: {str(e)}"
|
| 804 |
|
| 805 |
def delete_conversation_from_huggingface(conversation_id):
|
| 806 |
+
"""
|
| 807 |
+
Delete conversation files from Hugging Face dataset by ID
|
| 808 |
+
|
| 809 |
+
Args:
|
| 810 |
+
conversation_id: ID of conversation to delete
|
| 811 |
+
|
| 812 |
+
Returns:
|
| 813 |
+
Success status (bool) and message (str)
|
| 814 |
+
"""
|
| 815 |
try:
|
| 816 |
from huggingface_hub import HfApi, hf_hub_download
|
| 817 |
from huggingface_hub.utils import RepositoryNotFoundError, RevisionNotFoundError
|
|
|
|
| 879 |
|
| 880 |
|
| 881 |
def delete_conversation(conversation_id, evaluator):
|
| 882 |
+
"""
|
| 883 |
+
Delete conversation files by ID
|
| 884 |
+
|
| 885 |
+
Args:
|
| 886 |
+
conversation_id: ID of conversation to delete
|
| 887 |
+
evaluator: ChatEvaluator instance
|
| 888 |
+
|
| 889 |
+
Returns:
|
| 890 |
+
Message about deletion status
|
| 891 |
+
"""
|
| 892 |
try:
|
| 893 |
if not conversation_id:
|
| 894 |
return "Error: No conversation ID provided"
|