SondosMB commited on
Commit
8e8d6c7
Β·
verified Β·
1 Parent(s): e5fb143

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -31
app.py CHANGED
@@ -785,40 +785,29 @@ with gr.Blocks(css=css_tech_theme) as demo:
785
  eval_button = gr.Button("πŸ“ˆ Evaluate",scale=1,min_width=1200)
786
  submit_button = gr.Button("πŸ“€ Prove and Submit to Leaderboard", elem_id="evaluation-status", visible=False,scale=1,min_width=1200)
787
  eval_status = gr.Textbox(label="πŸ› οΈ Evaluation Status", interactive=False,scale=1,min_width=1200)
788
-
789
- # Define the functions outside the `with` block
790
- # def handle_evaluation(file, model_name):
791
- # # Check if required inputs are provided
792
- # if not file:
793
- # return "Error: Please upload a prediction file.", 0, gr.update(visible=False)
794
- # if not model_name or model_name.strip() == "":
795
- # return "Error: Please enter a model name.", 0, gr.update(visible=False)
796
-
797
- # try:
798
- # # Load predictions file
799
- # predictions_df = pd.read_csv(file.name)
800
-
801
- # # Validate required columns in the prediction file
802
- # required_columns = ['question_id', 'predicted_answer']
803
- # missing_columns = [col for col in required_columns if col not in predictions_df.columns]
804
- # if missing_columns:
805
- # return (f"Error: Missing required columns in prediction file: {', '.join(missing_columns)}.",
806
- # 0, gr.update(visible=False))
807
-
808
- # # Perform evaluation
809
- # status, leaderboard = evaluate_predictions(file, model_name, add_to_leaderboard=False)
810
- # if leaderboard.empty:
811
- # overall_accuracy = 0
812
- # else:
813
- # overall_accuracy = leaderboard.iloc[-1]["Overall Accuracy"]
814
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815
 
816
- # # Show the submit button after successful evaluation
817
- # return status, overall_accuracy, gr.update(visible=True)
 
 
818
 
819
- # except Exception as e:
820
- # # Handle unexpected errors
821
- # return f"Error during evaluation: {str(e)}", 0, gr.update(visible=False)
822
 
823
  def handle_evaluation(file, model_name, Team_name):
824
  if not file:
 
785
  eval_button = gr.Button("πŸ“ˆ Evaluate",scale=1,min_width=1200)
786
  submit_button = gr.Button("πŸ“€ Prove and Submit to Leaderboard", elem_id="evaluation-status", visible=False,scale=1,min_width=1200)
787
  eval_status = gr.Textbox(label="πŸ› οΈ Evaluation Status", interactive=False,scale=1,min_width=1200)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
788
 
789
+
790
+ with gr.TabItem("πŸ“€ Submission-Pro"):
791
+ gr.Markdown("""
792
+ <div class="submission-section" style="border: 3px solid #6a1b9a; padding: 20px; border-radius: 12px; box-shadow: 0 4px 10px rgba(106, 27, 154, 0.2);">
793
+ <h2 style="color: #6a1b9a; text-align: center;">Submit Your Predictions</h2>
794
+ <p style="font-size: 1.2em; color: #333; text-align: center;">Upload your prediction file and provide your model name to evaluate and optionally submit your results to the leaderboard.</p>
795
+ </div>
796
+ """)
797
+ with gr.Row(elem_id="submission-fields"):
798
+ file_input = gr.File(label="πŸ“‚ Upload Prediction CSV for Mobile-MMLU-Pro", file_types=[".csv"], interactive=True,scale=1, min_width=12000)
799
+ model_name_input = gr.Textbox(label="🏷️ Model Name", placeholder="Enter your model name",scale=1, min_width=800)
800
+ Team_name_input = gr.Textbox(label="🏷️ Team Name", placeholder="Enter your Team name",scale=1, min_width=800)
801
+
802
+ with gr.Row(elem_id="submission-results"):
803
+ overall_accuracy_display = gr.Number(label="πŸ“Š Overall Accuracy (%)", interactive=False,scale=1,min_width=1200)
804
 
805
+ with gr.Row(elem_id="submission-buttons"):
806
+ eval_button = gr.Button("πŸ“ˆ Evaluate",scale=1,min_width=1200)
807
+ submit_button = gr.Button("πŸ“€ Prove and Submit to Leaderboard", elem_id="evaluation-status", visible=False,scale=1,min_width=1200)
808
+ eval_status = gr.Textbox(label="πŸ› οΈ Evaluation Status", interactive=False,scale=1,min_width=1200)
809
 
810
+
 
 
811
 
812
  def handle_evaluation(file, model_name, Team_name):
813
  if not file: