Commit
4e587ce
·
verified ·
1 Parent(s): df4e9ef

Update src/populate.py

Browse files
Files changed (1) hide show
  1. src/populate.py +0 -21
src/populate.py CHANGED
@@ -42,27 +42,6 @@ def get_leaderboard_df(eval_results_path, eval_requests_path, cols, benchmark_co
42
  if 'average' in df.columns:
43
  df = df.sort_values(by=['average'], ascending=False)
44
 
45
- # 🔹 Fix Column Data Types for Correct Display in Gradio
46
- # Ensure numeric fields are properly converted
47
- NUMERIC_COLUMNS = ["average", "likes", "params"] + [col for col in df.columns if col not in [
48
- "model_name", "submitted_time", "base_model", "revision", "precision", "weight_type", "model_type", "license"
49
- ]]
50
-
51
- for col in NUMERIC_COLUMNS:
52
- if col in df.columns:
53
- df[col] = pd.to_numeric(df[col], errors="coerce") # Convert to float
54
-
55
- # Ensure categorical/text fields are properly converted to strings
56
- TEXT_COLUMNS = ["model_name", "submitted_time", "base_model", "revision", "precision", "weight_type", "model_type", "license"]
57
-
58
- for col in TEXT_COLUMNS:
59
- if col in df.columns:
60
- df[col] = df[col].astype(str)
61
-
62
- # Debug: Print column types
63
- print("✅ LEADERBOARD_DF Updated dtypes:\n", df.dtypes)
64
-
65
-
66
  return df
67
 
68
  def get_evaluation_queue_df(eval_requests_path, eval_cols):
 
42
  if 'average' in df.columns:
43
  df = df.sort_values(by=['average'], ascending=False)
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  return df
46
 
47
  def get_evaluation_queue_df(eval_requests_path, eval_cols):