Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -661,19 +661,11 @@ with gr.Blocks(css=css_tech_theme) as demo:
|
|
| 661 |
|
| 662 |
# Perform evaluation
|
| 663 |
status, leaderboard = evaluate_predictions(file, model_name, add_to_leaderboard=False)
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
# else:
|
| 667 |
-
# overall_accuracy = leaderboard.iloc[-1]["Overall Accuracy"]
|
| 668 |
-
|
| 669 |
-
# Perform evaluation
|
| 670 |
-
results = evaluate_predictions(file, model_name, add_to_leaderboard=False)
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
if results.get("overall_accuracy") is not None:
|
| 674 |
-
overall_accuracy = results["overall_accuracy"] * 100 # Convert to percentage
|
| 675 |
else:
|
| 676 |
-
overall_accuracy =
|
|
|
|
| 677 |
|
| 678 |
# Show the submit button after successful evaluation
|
| 679 |
return status, overall_accuracy, gr.update(visible=True)
|
|
|
|
| 661 |
|
| 662 |
# Perform evaluation
|
| 663 |
status, leaderboard = evaluate_predictions(file, model_name, add_to_leaderboard=False)
|
| 664 |
+
if leaderboard.empty:
|
| 665 |
+
overall_accuracy = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 666 |
else:
|
| 667 |
+
overall_accuracy = leaderboard.iloc[-1]["Overall Accuracy"]
|
| 668 |
+
|
| 669 |
|
| 670 |
# Show the submit button after successful evaluation
|
| 671 |
return status, overall_accuracy, gr.update(visible=True)
|