Spaces:
Running
Running
Filter out quantized models using base_model:quantized tag
Browse files- update_data.py +7 -4
update_data.py
CHANGED
|
@@ -100,16 +100,17 @@ def fetch_model_dates(model_ids: list[str], hf_token: str | None) -> dict[str, d
|
|
| 100 |
m = re.findall(r"[-_/](\d+\.?\d*)[Bb](?:[-_/]|$)", mid)
|
| 101 |
if m:
|
| 102 |
params_b = max(float(x) for x in m)
|
| 103 |
-
|
|
|
|
| 104 |
except Exception:
|
| 105 |
-
return mid, None, None
|
| 106 |
|
| 107 |
with ThreadPoolExecutor(max_workers=8) as pool:
|
| 108 |
futures = {pool.submit(_get_info, mid): mid for mid in model_ids}
|
| 109 |
for f in as_completed(futures):
|
| 110 |
-
mid, date, params = f.result()
|
| 111 |
if date:
|
| 112 |
-
results[mid] = {"date": date, "parameters_b": params}
|
| 113 |
|
| 114 |
return results
|
| 115 |
|
|
@@ -166,6 +167,8 @@ def main():
|
|
| 166 |
mid = row["model_id"]
|
| 167 |
if mid not in model_dates:
|
| 168 |
continue
|
|
|
|
|
|
|
| 169 |
provider = mid.split("/")[0] if "/" in mid else mid
|
| 170 |
short_name = mid.split("/")[-1]
|
| 171 |
all_providers.add(provider)
|
|
|
|
| 100 |
m = re.findall(r"[-_/](\d+\.?\d*)[Bb](?:[-_/]|$)", mid)
|
| 101 |
if m:
|
| 102 |
params_b = max(float(x) for x in m)
|
| 103 |
+
is_quantized = any(t.startswith("base_model:quantized:") for t in (info.tags or []))
|
| 104 |
+
return mid, info.created_at.strftime("%Y-%m-%d"), params_b, is_quantized
|
| 105 |
except Exception:
|
| 106 |
+
return mid, None, None, False
|
| 107 |
|
| 108 |
with ThreadPoolExecutor(max_workers=8) as pool:
|
| 109 |
futures = {pool.submit(_get_info, mid): mid for mid in model_ids}
|
| 110 |
for f in as_completed(futures):
|
| 111 |
+
mid, date, params, is_quantized = f.result()
|
| 112 |
if date:
|
| 113 |
+
results[mid] = {"date": date, "parameters_b": params, "is_quantized": is_quantized}
|
| 114 |
|
| 115 |
return results
|
| 116 |
|
|
|
|
| 167 |
mid = row["model_id"]
|
| 168 |
if mid not in model_dates:
|
| 169 |
continue
|
| 170 |
+
if model_dates[mid].get("is_quantized"):
|
| 171 |
+
continue
|
| 172 |
provider = mid.split("/")[0] if "/" in mid else mid
|
| 173 |
short_name = mid.split("/")[-1]
|
| 174 |
all_providers.add(provider)
|