Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -361,9 +361,6 @@ def plot_confusion_matrix(y_true, y_pred, title, save_path="confusion_matrix.png
|
|
361 |
plt.savefig(save_path, bbox_inches='tight', transparent=True)
|
362 |
plt.close()
|
363 |
|
364 |
-
# Ensure the file is properly written and synced to disk before opening
|
365 |
-
time.sleep(0.5) # Add a small delay to ensure file writing is complete
|
366 |
-
|
367 |
# Check if the file exists and can be opened
|
368 |
if not os.path.exists(save_path):
|
369 |
raise FileNotFoundError(f"File {save_path} not found.")
|
|
|
361 |
plt.savefig(save_path, bbox_inches='tight', transparent=True)
|
362 |
plt.close()
|
363 |
|
|
|
|
|
|
|
364 |
# Check if the file exists and can be opened
|
365 |
if not os.path.exists(save_path):
|
366 |
raise FileNotFoundError(f"File {save_path} not found.")
|