Update app.py
Browse files
app.py
CHANGED
@@ -661,10 +661,15 @@ 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 |
-
if leaderboard.empty:
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
666 |
else:
|
667 |
-
overall_accuracy =
|
668 |
|
669 |
# Show the submit button after successful evaluation
|
670 |
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 |
+
if results.get("overall_accuracy") is not None:
|
670 |
+
overall_accuracy = results["overall_accuracy"] * 100 # Convert to percentage
|
671 |
else:
|
672 |
+
overall_accuracy = 0
|
673 |
|
674 |
# Show the submit button after successful evaluation
|
675 |
return status, overall_accuracy, gr.update(visible=True)
|