hysts HF staff commited on
Commit
081a68a
•
1 Parent(s): 0c74571
Files changed (1) hide show
  1. app.py +18 -23
app.py CHANGED
@@ -99,46 +99,41 @@ def filter_models(
99
  print(f"Initial df shape: {df.shape}")
100
  print(f"Initial df content:\n{df}")
101
 
102
- filtered_df = df
103
-
104
  # Model Type フィルタリング
105
- type_column = "T" if "T" in df.columns else "Type_"
106
  type_emoji = [t.split()[0] for t in type_query]
107
- filtered_df = df[df[type_column].isin(type_emoji)]
108
- print(f"After type filter: {filtered_df.shape}")
109
 
110
  # Precision フィルタリング
111
- filtered_df = filtered_df[filtered_df["Precision"].isin(precision_query)]
112
- print(f"After precision filter: {filtered_df.shape}")
113
 
114
  # Model Size フィルタリング
115
- size_mask = filtered_df["#Params (B)"].apply(
116
- lambda x: any(x in NUMERIC_INTERVALS[s] for s in size_query if s != "Unknown")
117
- )
118
  if "Unknown" in size_query:
119
- size_mask |= filtered_df["#Params (B)"].isna() | (filtered_df["#Params (B)"] == 0)
120
- filtered_df = filtered_df[size_mask]
121
- print(f"After size filter: {filtered_df.shape}")
122
 
123
  # Add Special Tokens フィルタリング
124
- filtered_df = filtered_df[filtered_df["Add Special Tokens"].isin(add_special_tokens_query)]
125
- print(f"After add_special_tokens filter: {filtered_df.shape}")
126
 
127
  # Num Few Shots フィルタリング
128
- filtered_df = filtered_df[filtered_df["Few-shot"].astype(str).isin(num_few_shots_query)]
129
- print(f"After num_few_shots filter: {filtered_df.shape}")
130
 
131
  # Version フィルタリング
132
- filtered_df = filtered_df[filtered_df["llm-jp-eval version"].isin(version_query)]
133
- print(f"After version filter: {filtered_df.shape}")
134
 
135
  # Vllm Version フィルタリング
136
- filtered_df = filtered_df[filtered_df["vllm version"].isin(vllm_query)]
137
- print(f"After vllm version filter: {filtered_df.shape}")
138
 
139
  print("Filtered dataframe head:")
140
- print(filtered_df.head())
141
- return filtered_df
142
 
143
 
144
  def search_model_by_name(df: pd.DataFrame, model_name: str) -> pd.DataFrame:
 
99
  print(f"Initial df shape: {df.shape}")
100
  print(f"Initial df content:\n{df}")
101
 
 
 
102
  # Model Type フィルタリング
 
103
  type_emoji = [t.split()[0] for t in type_query]
104
+ df = df[df["T"].isin(type_emoji)]
105
+ print(f"After type filter: {df.shape}")
106
 
107
  # Precision フィルタリング
108
+ df = df[df["Precision"].isin(precision_query)]
109
+ print(f"After precision filter: {df.shape}")
110
 
111
  # Model Size フィルタリング
112
+ size_mask = df["#Params (B)"].apply(lambda x: any(x in NUMERIC_INTERVALS[s] for s in size_query if s != "Unknown"))
 
 
113
  if "Unknown" in size_query:
114
+ size_mask |= df["#Params (B)"].isna() | (df["#Params (B)"] == 0)
115
+ df = df[size_mask]
116
+ print(f"After size filter: {df.shape}")
117
 
118
  # Add Special Tokens フィルタリング
119
+ df = df[df["Add Special Tokens"].isin(add_special_tokens_query)]
120
+ print(f"After add_special_tokens filter: {df.shape}")
121
 
122
  # Num Few Shots フィルタリング
123
+ df = df[df["Few-shot"].astype(str).isin(num_few_shots_query)]
124
+ print(f"After num_few_shots filter: {df.shape}")
125
 
126
  # Version フィルタリング
127
+ df = df[df["llm-jp-eval version"].isin(version_query)]
128
+ print(f"After version filter: {df.shape}")
129
 
130
  # Vllm Version フィルタリング
131
+ df = df[df["vllm version"].isin(vllm_query)]
132
+ print(f"After vllm version filter: {df.shape}")
133
 
134
  print("Filtered dataframe head:")
135
+ print(df.head())
136
+ return df
137
 
138
 
139
  def search_model_by_name(df: pd.DataFrame, model_name: str) -> pd.DataFrame: