Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -182,9 +182,10 @@ def save_csv(*args):
|
|
182 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
183 |
csv_filename = f'edited_metadata_{timestamp}.csv'
|
184 |
df.to_csv(csv_filename, index=False)
|
185 |
-
return csv_filename # Return
|
186 |
except Exception as e:
|
187 |
-
return f"Error saving data: {e}"
|
|
|
188 |
|
189 |
|
190 |
# Functions to update character and keyword counts
|
|
|
182 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
183 |
csv_filename = f'edited_metadata_{timestamp}.csv'
|
184 |
df.to_csv(csv_filename, index=False)
|
185 |
+
return csv_filename, f"Data saved successfully to '{csv_filename}'!" # Return both the file path and success message
|
186 |
except Exception as e:
|
187 |
+
return None, f"Error saving data: {e}" # Return None for the file path and an error message
|
188 |
+
|
189 |
|
190 |
|
191 |
# Functions to update character and keyword counts
|