lewtun HF staff commited on
Commit
18133af
β€’
1 Parent(s): 74760ef

Refactor model filter

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -436,17 +436,6 @@ with st.form(key="form"):
436
  )
437
  print("INFO -- Selected models before filter:", selected_models)
438
 
439
- if len(selected_models) > 0:
440
- selected_models = filter_evaluated_models(
441
- selected_models,
442
- selected_task,
443
- selected_dataset,
444
- selected_config,
445
- selected_split,
446
- selected_metrics,
447
- )
448
- print("INFO -- Selected models after filter:", selected_models)
449
-
450
  hf_username = st.text_input("Enter your πŸ€— Hub username to be notified when the evaluation is finished")
451
 
452
  submit_button = st.form_submit_button("Evaluate models πŸš€")
@@ -456,7 +445,18 @@ with st.form(key="form"):
456
  st.warning("No πŸ€— Hub username provided! Please enter your username and try again.")
457
  elif len(selected_models) > 10:
458
  st.warning("Only 10 models can be evaluated at once. Please select fewer models to evaluate.")
459
- elif len(selected_models) > 0 and len(selected_models) <= 10:
 
 
 
 
 
 
 
 
 
 
 
460
  project_id = str(uuid.uuid4())[:8]
461
  project_payload = {
462
  "username": AUTOTRAIN_USERNAME,
 
436
  )
437
  print("INFO -- Selected models before filter:", selected_models)
438
 
 
 
 
 
 
 
 
 
 
 
 
439
  hf_username = st.text_input("Enter your πŸ€— Hub username to be notified when the evaluation is finished")
440
 
441
  submit_button = st.form_submit_button("Evaluate models πŸš€")
 
445
  st.warning("No πŸ€— Hub username provided! Please enter your username and try again.")
446
  elif len(selected_models) > 10:
447
  st.warning("Only 10 models can be evaluated at once. Please select fewer models to evaluate.")
448
+ elif len(selected_models) > 0:
449
+ # Filter out previsouly evaluated models
450
+ selected_models = filter_evaluated_models(
451
+ selected_models,
452
+ selected_task,
453
+ selected_dataset,
454
+ selected_config,
455
+ selected_split,
456
+ selected_metrics,
457
+ )
458
+ print("INFO -- Selected models after filter:", selected_models)
459
+
460
  project_id = str(uuid.uuid4())[:8]
461
  project_payload = {
462
  "username": AUTOTRAIN_USERNAME,