Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Fix
Browse files
app.py
CHANGED
@@ -109,10 +109,14 @@ def filter_models(
|
|
109 |
print(f"After precision filter: {df.shape}")
|
110 |
|
111 |
# Model Size フィルタリング
|
112 |
-
|
113 |
-
if
|
114 |
-
size_mask
|
115 |
-
|
|
|
|
|
|
|
|
|
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 フィルタリング
|