hysts HF staff commited on
Commit
5df655f
•
1 Parent(s): 081a68a
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -109,10 +109,14 @@ def filter_models(
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 フィルタリング
 
109
  print(f"After precision filter: {df.shape}")
110
 
111
  # Model Size フィルタリング
112
+ # When `df` is empty, `size_mask` is empty, and the shape of `df[size_mask]` becomes (0, 0).
113
+ if len(df) > 0:
114
+ size_mask = df["#Params (B)"].apply(
115
+ lambda x: any(x in NUMERIC_INTERVALS[s] for s in size_query if s != "Unknown")
116
+ )
117
+ if "Unknown" in size_query:
118
+ size_mask |= df["#Params (B)"].isna() | (df["#Params (B)"] == 0)
119
+ df = df[size_mask]
120
  print(f"After size filter: {df.shape}")
121
 
122
  # Add Special Tokens フィルタリング