Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clean up
Browse files
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 |
-
|
108 |
-
print(f"After type filter: {
|
109 |
|
110 |
# Precision フィルタリング
|
111 |
-
|
112 |
-
print(f"After precision filter: {
|
113 |
|
114 |
# Model Size フィルタリング
|
115 |
-
size_mask =
|
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 |=
|
120 |
-
|
121 |
-
print(f"After size filter: {
|
122 |
|
123 |
# Add Special Tokens フィルタリング
|
124 |
-
|
125 |
-
print(f"After add_special_tokens filter: {
|
126 |
|
127 |
# Num Few Shots フィルタリング
|
128 |
-
|
129 |
-
print(f"After num_few_shots filter: {
|
130 |
|
131 |
# Version フィルタリング
|
132 |
-
|
133 |
-
print(f"After version filter: {
|
134 |
|
135 |
# Vllm Version フィルタリング
|
136 |
-
|
137 |
-
print(f"After vllm version filter: {
|
138 |
|
139 |
print("Filtered dataframe head:")
|
140 |
-
print(
|
141 |
-
return
|
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:
|