SondosMB commited on
Commit
8bf3c31
Β·
verified Β·
1 Parent(s): 5bafd2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -937,12 +937,15 @@ with gr.Blocks(css=css_tech_theme) as demo:
937
 
938
 
939
  def handle_evaluation(file, model_name, Team_name):
940
- print("πŸš€ Evaluation function started") # Debugging print
941
  if not file:
 
942
  return "Error: Please upload a prediction file.", 0, gr.update(visible=False)
943
  if not model_name or model_name.strip() == "":
 
944
  return "Error: Please enter a model name.", 0, gr.update(visible=False)
945
  if not Team_name or Team_name.strip() == "":
 
946
  return "Error: Please enter a Team name.", 0, gr.update(visible=False)
947
 
948
  try:
@@ -1027,7 +1030,9 @@ with gr.Blocks(css=css_tech_theme) as demo:
1027
  return "Evaluation completed successfully.", overall_accuracy, gr.update(visible=True)
1028
 
1029
  except Exception as e:
1030
- return f"Error during evaluation: {str(e)}", 0, gr.update(visible=False)
 
 
1031
 
1032
 
1033
 
@@ -1043,21 +1048,11 @@ with gr.Blocks(css=css_tech_theme) as demo:
1043
 
1044
 
1045
  # Connect button clicks to the functions
1046
- # eval_button.click(
1047
- # handle_evaluation,
1048
- # inputs=[file_input, model_name_input,Team_name_input],
1049
- # outputs=[eval_status, overall_accuracy_display, submit_button],
1050
- # )
1051
-
1052
- try:
1053
- eval_button.click(
1054
- handle_evaluation,
1055
- inputs=[file_input, model_name_input, Team_name_input],
1056
- outputs=[eval_status, overall_accuracy_display, submit_button],)
1057
- print("βœ… eval_button linked successfully") # Debugging print
1058
- except Exception as e:
1059
- print(f"❌ Error linking eval_button: {str(e)}")
1060
-
1061
 
1062
  eval_button_pro.click(
1063
  handle_evaluation_pro,
 
937
 
938
 
939
  def handle_evaluation(file, model_name, Team_name):
940
+ print("πŸš€ Evaluation function started 1") # Debugging print
941
  if not file:
942
+ print("πŸš€ Evaluation function started 2") # Debugging print
943
  return "Error: Please upload a prediction file.", 0, gr.update(visible=False)
944
  if not model_name or model_name.strip() == "":
945
+ print("πŸš€ Evaluation function started 3") # Debugging print
946
  return "Error: Please enter a model name.", 0, gr.update(visible=False)
947
  if not Team_name or Team_name.strip() == "":
948
+ print("πŸš€ Evaluation function started 4") # Debugging print
949
  return "Error: Please enter a Team name.", 0, gr.update(visible=False)
950
 
951
  try:
 
1030
  return "Evaluation completed successfully.", overall_accuracy, gr.update(visible=True)
1031
 
1032
  except Exception as e:
1033
+ return f"Error during evaluation: {str(e)}", 0, gr.update(visible=False)
1034
+
1035
+
1036
 
1037
 
1038
 
 
1048
 
1049
 
1050
  # Connect button clicks to the functions
1051
+ eval_button.click(
1052
+ handle_evaluation,
1053
+ inputs=[file_input, model_name_input,Team_name_input],
1054
+ outputs=[eval_status, overall_accuracy_display, submit_button],
1055
+ )
 
 
 
 
 
 
 
 
 
 
1056
 
1057
  eval_button_pro.click(
1058
  handle_evaluation_pro,