2026-11-17.8: public dashboard data, PE untracked, NSFW rule
Browse files- code/README.md +1 -1
- code/hfeco/classify.py +2 -2
- code/hfeco/families/h3.py +1 -1
- code/hfeco/family.py +6 -0
- code/hfeco/metrics.py +65 -66
- code/octo-hf/README.md +1 -1
- code/octo-hf/hf_basemodel.py +2 -1
- code/space/index.html +221 -245
- labels/h3/latest.parquet +2 -2
code/README.md
CHANGED
|
@@ -34,7 +34,7 @@ cache/<family>/enrich.jsonl 每个仓库的证据,按仓库 sha 缓存
|
|
| 34 |
|
| 35 |
## 加一个模型家族
|
| 36 |
|
| 37 |
-
1. 写 `hfeco/families/<key>.py`,按 `family.py` 的字段填:成员和官方仓库、搜索词、能区分成员的结构指纹(独有的层、config 里的架构名、训练元数据里的字样)、抽查用的张量名。
|
| 38 |
2. 在 `hfeco/families/__init__.py` 里注册。
|
| 39 |
3. `python scripts/build_reference.py --family <key>` 生成官方参考数据。
|
| 40 |
4. `python scripts/daily.py --family <key>` 试跑,用 `eval/` 的方法抽样核对准确率。
|
|
|
|
| 34 |
|
| 35 |
## 加一个模型家族
|
| 36 |
|
| 37 |
+
1. 写 `hfeco/families/<key>.py`,按 `family.py` 的字段填:成员和官方仓库、搜索词、能区分成员的结构指纹(独有的层、config 里的架构名、训练元数据里的字样)、抽查用的张量名。只用来区分、不需要展示的成员(比如 H3 家族的 H3-Image-PE)写 `tracked=False`:照常分类,好把它的衍生品从别的成员里排除,但不上看板、不进 PR 候选。
|
| 38 |
2. 在 `hfeco/families/__init__.py` 里注册。
|
| 39 |
3. `python scripts/build_reference.py --family <key>` 生成官方参考数据。
|
| 40 |
4. `python scripts/daily.py --family <key>` 试跑,用 `eval/` 的方法抽样核对准确率。
|
code/hfeco/classify.py
CHANGED
|
@@ -16,7 +16,7 @@ import re
|
|
| 16 |
|
| 17 |
import numpy as np
|
| 18 |
|
| 19 |
-
VERSION = "2026-11-17.
|
| 20 |
DERIVED = {"adapter", "finetune", "merge", "quantized", "repackage", "mirror", "component"}
|
| 21 |
HF_RELATIONS = {"adapter", "finetune", "merge", "quantized"}
|
| 22 |
SAME = 1e-3 # probe distance below this = same weights (bf16 -> fp16 copies land at ~0)
|
|
@@ -31,7 +31,7 @@ TUNED_NAME = re.compile(r"finetun|fine-tun|\bft\b|turbo|lightning|distill|\d+[-_
|
|
| 31 |
r"lcm|dmd|pdmd|singularity|eros|nsfw|uncensor|heretic|abliterat", re.I)
|
| 32 |
DISTILL_NAME = re.compile(r"turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|lcm|dmd|pdmd|fast", re.I)
|
| 33 |
NSFW = re.compile(r"nsfw|porn|hentai|nude|nudity|\bsex|dildo|cumshot|\bcum\b|pussy|deepthroat|blowjob|"
|
| 34 |
-
r"erotic|\
|
| 35 |
# Training/merge tools describe merges in prose; quantizers have a bare "merge" field for a compute step.
|
| 36 |
META_MERGE = re.compile(r"lora[ _-]?merg|merged|graft|merge[ _](of|from|method|ratio|weights)|linear merge|"
|
| 37 |
r"consensus merge|baked", re.I)
|
|
|
|
| 16 |
|
| 17 |
import numpy as np
|
| 18 |
|
| 19 |
+
VERSION = "2026-11-17.8"
|
| 20 |
DERIVED = {"adapter", "finetune", "merge", "quantized", "repackage", "mirror", "component"}
|
| 21 |
HF_RELATIONS = {"adapter", "finetune", "merge", "quantized"}
|
| 22 |
SAME = 1e-3 # probe distance below this = same weights (bf16 -> fp16 copies land at ~0)
|
|
|
|
| 31 |
r"lcm|dmd|pdmd|singularity|eros|nsfw|uncensor|heretic|abliterat", re.I)
|
| 32 |
DISTILL_NAME = re.compile(r"turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|lcm|dmd|pdmd|fast", re.I)
|
| 33 |
NSFW = re.compile(r"nsfw|porn|hentai|nude|nudity|\bsex|dildo|cumshot|\bcum\b|pussy|deepthroat|blowjob|"
|
| 34 |
+
r"erotic|(?:\b|(?<=\d)|(?<=ten)|(?<=_))eros(?![a-z])|xxx|uncensor", re.I) # "10Eros", "TenEros"
|
| 35 |
# Training/merge tools describe merges in prose; quantizers have a bare "merge" field for a compute step.
|
| 36 |
META_MERGE = re.compile(r"lora[ _-]?merg|merged|graft|merge[ _](of|from|method|ratio|weights)|linear merge|"
|
| 37 |
r"consensus merge|baked", re.I)
|
code/hfeco/families/h3.py
CHANGED
|
@@ -38,7 +38,7 @@ FAMILY = Family(
|
|
| 38 |
members=[
|
| 39 |
Member("H3", "MiniMaxAI/MiniMax-H3", "video", None),
|
| 40 |
Member("H3-Image", "MiniMaxAI/MiniMax-H3-Image", "image", IMAGE_TEXT),
|
| 41 |
-
Member("H3-Image-PE", "MiniMaxAI/MiniMax-H3-Image-PE", "text", PE_TEXT),
|
| 42 |
],
|
| 43 |
default_member="H3",
|
| 44 |
name_queries=["h3", "hailuo"],
|
|
|
|
| 38 |
members=[
|
| 39 |
Member("H3", "MiniMaxAI/MiniMax-H3", "video", None),
|
| 40 |
Member("H3-Image", "MiniMaxAI/MiniMax-H3-Image", "image", IMAGE_TEXT),
|
| 41 |
+
Member("H3-Image-PE", "MiniMaxAI/MiniMax-H3-Image-PE", "text", PE_TEXT, tracked=False),
|
| 42 |
],
|
| 43 |
default_member="H3",
|
| 44 |
name_queries=["h3", "hailuo"],
|
code/hfeco/family.py
CHANGED
|
@@ -18,6 +18,8 @@ class Member:
|
|
| 18 |
base: str # official repo id
|
| 19 |
modality: str # video | image | text | audio | ...
|
| 20 |
text_hint: Optional[re.Pattern] = None # how cards/names refer to this member specifically
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
@dataclass
|
|
@@ -63,6 +65,10 @@ class Family:
|
|
| 63 |
def lineages(self):
|
| 64 |
return [m.lineage for m in self.members]
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
@property
|
| 67 |
def bases(self):
|
| 68 |
return [m.base for m in self.members]
|
|
|
|
| 18 |
base: str # official repo id
|
| 19 |
modality: str # video | image | text | audio | ...
|
| 20 |
text_hint: Optional[re.Pattern] = None # how cards/names refer to this member specifically
|
| 21 |
+
tracked: bool = True # False: still classified (so its derivatives are kept out of
|
| 22 |
+
# the others), but not on the dashboard or in PR candidates
|
| 23 |
|
| 24 |
|
| 25 |
@dataclass
|
|
|
|
| 65 |
def lineages(self):
|
| 66 |
return [m.lineage for m in self.members]
|
| 67 |
|
| 68 |
+
@property
|
| 69 |
+
def tracked(self):
|
| 70 |
+
return [m for m in self.members if m.tracked]
|
| 71 |
+
|
| 72 |
@property
|
| 73 |
def bases(self):
|
| 74 |
return [m.base for m in self.members]
|
code/hfeco/metrics.py
CHANGED
|
@@ -29,91 +29,90 @@ def daily_downloads(raw):
|
|
| 29 |
|
| 30 |
|
| 31 |
def build(raw, labels, hf_tree_counts, fam):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
days = sorted(raw.day.unique())
|
| 33 |
today = days[-1]
|
| 34 |
lab = pd.DataFrame(labels)
|
| 35 |
cur = raw[raw.day == today].merge(lab, on=["kind", "repo_id"], how="left")
|
| 36 |
dd = daily_downloads(raw)
|
|
|
|
|
|
|
| 37 |
famdf = cur[cur.family.fillna(False).astype(bool)]
|
| 38 |
|
| 39 |
-
out = {"
|
| 40 |
-
"snapshot_days": days, "today": today,
|
| 41 |
-
"classifier_version": lab.classifier_version.iloc[0] if len(lab) else None,
|
| 42 |
"family": {"key": fam.key, "title": fam.title,
|
| 43 |
-
"members": [{"lineage": m.lineage, "base": m.base
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
lob = fam.lineage_of_base()
|
| 47 |
-
for lin in fam.lineages:
|
| 48 |
base = fam.base_of(lin)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
# daily series by relation
|
| 56 |
-
d = dd[dd.kind == "model"].merge(models[["repo_id", "relation"]], on="repo_id")
|
| 57 |
-
daily = (d.dropna(subset=["daily"]).groupby(["day", "relation"]).daily.sum()
|
| 58 |
-
.round().astype(int).reset_index())
|
| 59 |
-
off_daily = dd[(dd.kind == "model") & (dd.repo_id == base)].dropna(subset=["daily"])
|
| 60 |
-
# growth by creation date (real history)
|
| 61 |
-
cr = models.assign(month=models.created_at.str[:10]).groupby(["month", "relation"]).size()
|
| 62 |
-
growth = [{"date": k[0], "relation": k[1], "n": int(v)} for k, v in cr.items()]
|
| 63 |
-
by_rel = {}
|
| 64 |
-
is_copy = models["flags"].apply(lambda f: "copy" in (f if isinstance(f, list) else []))
|
| 65 |
-
for rel in REL_ORDER:
|
| 66 |
-
m = models[models.relation == rel]
|
| 67 |
-
by_rel[rel] = {"n": int(len(m)), "dl30": int(m.downloads_30d.fillna(0).sum()),
|
| 68 |
-
"dlall": int(m.downloads_all_time.fillna(0).sum()),
|
| 69 |
-
"copies": int(is_copy[models.relation == rel].sum())}
|
| 70 |
-
decl = models.declared_status.value_counts().to_dict()
|
| 71 |
out["lineages"][lin] = {
|
| 72 |
"base": base,
|
| 73 |
-
"official": {"dl30": _i(off.downloads_30d), "dlall": _i(off.downloads_all_time),
|
| 74 |
-
"likes": _i(off.likes),
|
| 75 |
-
"daily": [{"day": r.day, "n": int(round(r.daily))} for r in off_daily.itertuples()]},
|
| 76 |
"n_models": int(len(models)),
|
| 77 |
-
"n_copies": int(is_copy.sum()),
|
| 78 |
"dl30": int(models.downloads_30d.fillna(0).sum()),
|
| 79 |
"dlall": int(models.downloads_all_time.fillna(0).sum()),
|
| 80 |
-
"
|
| 81 |
-
|
| 82 |
-
|
|
|
|
| 83 |
"hf_tree": hf_tree_counts.get(base, {}),
|
| 84 |
-
"
|
| 85 |
-
"
|
| 86 |
-
"daily": daily.to_dict("records"),
|
| 87 |
-
"growth": growth,
|
| 88 |
}
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
keep = cur[cur.family.fillna(False).astype(bool) | cur.repo_id.isin(hf_base_children)]
|
| 100 |
-
for r in keep.itertuples():
|
| 101 |
-
rows.append({
|
| 102 |
-
"id": r.repo_id, "kind": r.kind, "lineage": r.lineage, "relation": r.relation,
|
| 103 |
-
"conf": r.confidence, "dl30": _i(r.downloads_30d), "dlall": _i(r.downloads_all_time),
|
| 104 |
-
"d1": None if pd.isna(last.get((r.kind, r.repo_id))) else int(round(last.get((r.kind, r.repo_id)))),
|
| 105 |
-
"likes": _i(r.likes), "created": (r.created_at or "")[:10],
|
| 106 |
-
"declared": r.declared_status if isinstance(r.declared_status, str) else None,
|
| 107 |
-
"hf_under": hf_base_children.get(r.repo_id),
|
| 108 |
-
"proposed": r.proposed_base_model if isinstance(r.proposed_base_model, str) else None,
|
| 109 |
-
"copy_of": r.copy_of if isinstance(r.copy_of, str) else None,
|
| 110 |
-
"flags": list(r.flags) if isinstance(r.flags, list) else [],
|
| 111 |
-
"evidence": list(r.evidence) if isinstance(r.evidence, list) else [],
|
| 112 |
-
})
|
| 113 |
-
out["repos"] = rows
|
| 114 |
return out
|
| 115 |
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
def hf_tree_counts(raw_today, fam):
|
| 118 |
"""What the Hub's Model tree shows: direct children per relation tag."""
|
| 119 |
out = {b: {k: 0 for k in HF_ORDER} for b in fam.bases}
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
def build(raw, labels, hf_tree_counts, fam):
|
| 32 |
+
"""The dashboard's data file. The Space may become public, so this is a whitelist of
|
| 33 |
+
what the page renders: no evidence, confidence, declaration status or flags, and no
|
| 34 |
+
names of NSFW repos (they still count in the totals). Internal detail stays in the
|
| 35 |
+
labels parquet in the private dataset."""
|
| 36 |
days = sorted(raw.day.unique())
|
| 37 |
today = days[-1]
|
| 38 |
lab = pd.DataFrame(labels)
|
| 39 |
cur = raw[raw.day == today].merge(lab, on=["kind", "repo_id"], how="left")
|
| 40 |
dd = daily_downloads(raw)
|
| 41 |
+
dd = dd[dd.kind == "model"]
|
| 42 |
+
last = dd[dd.day == today].set_index("repo_id").daily.to_dict()
|
| 43 |
famdf = cur[cur.family.fillna(False).astype(bool)]
|
| 44 |
|
| 45 |
+
out = {"today": today, "snapshot_days": days,
|
|
|
|
|
|
|
| 46 |
"family": {"key": fam.key, "title": fam.title,
|
| 47 |
+
"members": [{"lineage": m.lineage, "base": m.base} for m in fam.tracked]},
|
| 48 |
+
"rel_order": REL_ORDER, "lineages": {}, "repos": []}
|
| 49 |
+
for lin in [m.lineage for m in fam.tracked]:
|
|
|
|
|
|
|
| 50 |
base = fam.base_of(lin)
|
| 51 |
+
models = famdf[(famdf.lineage == lin) & (famdf.kind == "model") & famdf.relation.isin(REL_ORDER)
|
| 52 |
+
& (famdf.repo_id != base)]
|
| 53 |
+
off = cur[(cur.kind == "model") & (cur.repo_id == base)]
|
| 54 |
+
d = dd.merge(models[["repo_id"]], on="repo_id").dropna(subset=["daily"])
|
| 55 |
+
daily = d.groupby("day").daily.sum().round().astype(int)
|
| 56 |
+
growth = models.created_at.str[:10].value_counts().sort_index()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
out["lineages"][lin] = {
|
| 58 |
"base": base,
|
| 59 |
+
"official": {"dl30": _i(off.downloads_30d), "dlall": _i(off.downloads_all_time)},
|
|
|
|
|
|
|
| 60 |
"n_models": int(len(models)),
|
|
|
|
| 61 |
"dl30": int(models.downloads_30d.fillna(0).sum()),
|
| 62 |
"dlall": int(models.downloads_all_time.fillna(0).sum()),
|
| 63 |
+
"by_relation": {rel: {"n": int((models.relation == rel).sum()),
|
| 64 |
+
"dl30": int(models[models.relation == rel].downloads_30d.fillna(0).sum()),
|
| 65 |
+
"dlall": int(models[models.relation == rel].downloads_all_time.fillna(0).sum())}
|
| 66 |
+
for rel in REL_ORDER},
|
| 67 |
"hf_tree": hf_tree_counts.get(base, {}),
|
| 68 |
+
"daily": [{"day": k, "n": int(v)} for k, v in daily.items()],
|
| 69 |
+
"growth": [{"date": k, "n": int(v)} for k, v in growth.items()],
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
+
up = tree_parents(models, base)
|
| 72 |
+
nsfw = set(models[models["flags"].apply(lambda f: "nsfw" in (f if isinstance(f, list) else []))].repo_id)
|
| 73 |
+
for r in models[~models.repo_id.isin(nsfw)].itertuples():
|
| 74 |
+
p = up[r.repo_id]
|
| 75 |
+
while p in nsfw: # hidden repos keep their place in the totals, not in the tree
|
| 76 |
+
p = up[p]
|
| 77 |
+
v = last.get(r.repo_id)
|
| 78 |
+
out["repos"].append({"id": r.repo_id, "lin": lin, "rel": r.relation, "up": p,
|
| 79 |
+
"dl30": _i(r.downloads_30d), "dlall": _i(r.downloads_all_time),
|
| 80 |
+
"d1": None if v is None or pd.isna(v) else int(round(v))})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
return out
|
| 82 |
|
| 83 |
|
| 84 |
+
def tree_parents(models, base):
|
| 85 |
+
"""Parent of every derived model, for the tree.
|
| 86 |
+
|
| 87 |
+
1. a declared base_model that is itself a derived model of the same member
|
| 88 |
+
2. the official base, if the author declared it
|
| 89 |
+
3. the community repo this one is a byte-identical copy of
|
| 90 |
+
4. otherwise the official base (what the weights say it is built on)
|
| 91 |
+
"""
|
| 92 |
+
ids = set(models.repo_id)
|
| 93 |
+
up = {}
|
| 94 |
+
for r in models.itertuples():
|
| 95 |
+
decl = list(r.card_base_model or [])
|
| 96 |
+
fam_decl = [p for p in decl if p in ids and p != r.repo_id]
|
| 97 |
+
if fam_decl:
|
| 98 |
+
up[r.repo_id] = fam_decl[0]
|
| 99 |
+
elif base in decl:
|
| 100 |
+
up[r.repo_id] = base
|
| 101 |
+
elif isinstance(r.copy_of, str) and r.copy_of in ids and r.copy_of != r.repo_id:
|
| 102 |
+
up[r.repo_id] = r.copy_of
|
| 103 |
+
else:
|
| 104 |
+
up[r.repo_id] = base
|
| 105 |
+
for x in ids: # break cycles (A declares B, B declares A)
|
| 106 |
+
seen, p = {x}, up[x]
|
| 107 |
+
while p != base:
|
| 108 |
+
if p in seen:
|
| 109 |
+
up[x] = base
|
| 110 |
+
break
|
| 111 |
+
seen.add(p)
|
| 112 |
+
p = up[p]
|
| 113 |
+
return up
|
| 114 |
+
|
| 115 |
+
|
| 116 |
def hf_tree_counts(raw_today, fam):
|
| 117 |
"""What the Hub's Model tree shows: direct children per relation tag."""
|
| 118 |
out = {b: {k: 0 for k in HF_ORDER} for b in fam.bases}
|
code/octo-hf/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Repo 主表每行一个仓库,去重键沿用 `repo_url + reason`:
|
|
| 32 |
- `hf-base-model-relation` 默认不提(`--include-relation` 打开):关系是作者自己选的,我们在这类上也更容易错
|
| 33 |
- 每天最多 20 个(`--limit`),按近 30 天下载从高到低
|
| 34 |
|
| 35 |
-
2026-11-17 的数据按这些条件有
|
| 36 |
|
| 37 |
## PR 内容
|
| 38 |
|
|
|
|
| 32 |
- `hf-base-model-relation` 默认不提(`--include-relation` 打开):关系是作者自己选的,我们在这类上也更容易错
|
| 33 |
- 每天最多 20 个(`--limit`),按近 30 天下载从高到低
|
| 34 |
|
| 35 |
+
只给看板上展示的成员(`tracked=True`)提。2026-11-17 的数据按这些条件有 56 个候选,都是"没写 base_model"。
|
| 36 |
|
| 37 |
## PR 内容
|
| 38 |
|
code/octo-hf/hf_basemodel.py
CHANGED
|
@@ -49,7 +49,8 @@ def candidates(fam, min_downloads, limit, include_relation=False):
|
|
| 49 |
df = lab.merge(raw, on="repo_id")
|
| 50 |
df["flags"] = df["flags"].apply(json.loads)
|
| 51 |
df["evidence"] = df.evidence.apply(json.loads)
|
| 52 |
-
keep = df[(df.kind == "model") & df.
|
|
|
|
| 53 |
& ~df["flags"].apply(lambda f: "nsfw" in f or "copy" in f) & (df.downloads_all_time.fillna(0) >= min_downloads)
|
| 54 |
& (df.gated == "False")]
|
| 55 |
if not include_relation:
|
|
|
|
| 49 |
df = lab.merge(raw, on="repo_id")
|
| 50 |
df["flags"] = df["flags"].apply(json.loads)
|
| 51 |
df["evidence"] = df.evidence.apply(json.loads)
|
| 52 |
+
keep = df[(df.kind == "model") & df.lineage.isin([m.lineage for m in fam.tracked])
|
| 53 |
+
& df.declared_status.isin(list(REASON)) & (df.confidence == "high")
|
| 54 |
& ~df["flags"].apply(lambda f: "nsfw" in f or "copy" in f) & (df.downloads_all_time.fillna(0) >= min_downloads)
|
| 55 |
& (df.gated == "False")]
|
| 56 |
if not include_relation:
|
code/space/index.html
CHANGED
|
@@ -11,85 +11,81 @@
|
|
| 11 |
--page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
|
| 12 |
--grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10); --wash: #f0efec;
|
| 13 |
--s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
|
| 14 |
-
--
|
| 15 |
}
|
| 16 |
@media (prefers-color-scheme: dark) {
|
| 17 |
:root:not([data-theme="light"]) {
|
| 18 |
color-scheme: dark;
|
| 19 |
--page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
|
| 20 |
-
--grid: #2c2c2a; --axis: #
|
| 21 |
--s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
|
| 22 |
-
--
|
| 23 |
}
|
| 24 |
}
|
| 25 |
:root[data-theme="dark"] {
|
| 26 |
color-scheme: dark;
|
| 27 |
--page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
|
| 28 |
-
--grid: #2c2c2a; --axis: #
|
| 29 |
--s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
|
| 30 |
-
--
|
| 31 |
}
|
| 32 |
* { box-sizing: border-box; }
|
| 33 |
body { margin: 0; background: var(--page); color: var(--ink);
|
| 34 |
-
font:
|
| 35 |
-
.wrap { max-width: 1240px; margin: 0 auto; padding:
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
.
|
| 40 |
-
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 3px; }
|
| 41 |
-
.seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 15px; padding: 7px 16px; border-radius: 7px; cursor: pointer; }
|
| 42 |
.seg button[aria-pressed="true"] { background: var(--wash); color: var(--ink); font-weight: 600; }
|
| 43 |
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
| 44 |
-
|
| 45 |
-
.
|
| 46 |
-
.tile
|
| 47 |
-
.tile .
|
| 48 |
-
.tile .
|
| 49 |
-
.
|
| 50 |
-
.card {
|
| 51 |
-
.card h2 { font-size: 17px; margin: 0 0 2px; font-weight: 620; }
|
| 52 |
-
.card .desc { color: var(--ink2); font-size: 14px; margin: 0 0 12px; }
|
| 53 |
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
| 54 |
-
.row2
|
| 55 |
-
.
|
| 56 |
@media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
|
| 57 |
-
.
|
| 58 |
-
.
|
| 59 |
-
.legend
|
| 60 |
-
.
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
th { color: var(--ink2); font-weight: 560; white-space: nowrap; }
|
| 64 |
th.sortable { cursor: pointer; user-select: none; }
|
| 65 |
th.sortable:hover { color: var(--ink); }
|
| 66 |
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
| 67 |
-
tr.
|
| 68 |
-
.
|
| 69 |
.tablewrap { overflow-x: auto; }
|
| 70 |
a { color: var(--accent); text-decoration: none; }
|
| 71 |
a:hover { text-decoration: underline; }
|
| 72 |
-
.repo {
|
| 73 |
-
|
| 74 |
-
.
|
| 75 |
-
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
|
| 76 |
-
#famSel, .filters input[type=search], .filters select { font: inherit; font-size: 14px; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 6px 10px; }
|
| 77 |
-
.filters input[type=search] { min-width: 240px; flex: 1; max-width: 380px; }
|
| 78 |
-
.filters label { color: var(--ink2); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
|
| 79 |
-
details summary { cursor: pointer; color: var(--ink2); font-size: 13.5px; white-space: nowrap; }
|
| 80 |
-
details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13.5px; }
|
| 81 |
-
.more { margin-top: 10px; font: inherit; font-size: 14px; background: var(--wash); color: var(--ink); border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
|
| 82 |
-
.method p { color: var(--ink2); font-size: 14px; margin: 6px 0; }
|
| 83 |
-
.method b { color: var(--ink); font-weight: 600; }
|
| 84 |
</style>
|
| 85 |
</head>
|
| 86 |
<body>
|
| 87 |
<div class="wrap">
|
| 88 |
<header>
|
| 89 |
-
<
|
| 90 |
-
<h1 id="title">MiniMax 开源生态</h1>
|
| 91 |
-
<div class="sub" id="asof">加载中…</div>
|
| 92 |
-
</div>
|
| 93 |
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center">
|
| 94 |
<select id="famSel" aria-label="选择模型家族" hidden></select>
|
| 95 |
<div class="seg" role="group" aria-label="选择模型" id="lineageSeg"></div>
|
|
@@ -98,78 +94,49 @@ details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink2); font-size:
|
|
| 98 |
|
| 99 |
<div class="tiles" id="tiles"></div>
|
| 100 |
|
| 101 |
-
<
|
| 102 |
-
<
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
<div id="dailyChart" class="chart"></div>
|
| 107 |
-
</section>
|
| 108 |
-
<section class="card">
|
| 109 |
-
<h2>每周新增衍生模型</h2>
|
| 110 |
-
<p class="desc">按仓库创建日期统计,可以看到发布以来的完整历史。</p>
|
| 111 |
-
<div class="legend" data-legend></div>
|
| 112 |
-
<div id="growthChart" class="chart"></div>
|
| 113 |
-
</section>
|
| 114 |
-
</div>
|
| 115 |
|
| 116 |
<section class="card">
|
| 117 |
<h2>按关系类型</h2>
|
| 118 |
-
<p class="desc">我们按权重内容识别的数字,和 HF Model tree 按声明显示的数字并排。HF 只有前四种关系,重打包、官方权重转存和配套组件在 HF 上会被算成 finetune 或者不显示。"整仓复制"指整个仓库的权重和别人更早的仓库逐字节相同,按内容照常归类,单独列出数量。</p>
|
| 119 |
<div class="tablewrap"><table id="relTable"></table></div>
|
| 120 |
</section>
|
| 121 |
|
| 122 |
-
<
|
| 123 |
-
<
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
<section class="card">
|
| 129 |
-
<h2>全部
|
| 130 |
-
<
|
| 131 |
-
<div class="filters">
|
| 132 |
-
<input type="search" id="q" placeholder="搜索仓库名" aria-label="搜索仓库名">
|
| 133 |
-
<select id="fKind" aria-label="类型"><option value="">模型、Space、数据集</option><option value="model">模型</option><option value="space">Space</option><option value="dataset">数据集</option></select>
|
| 134 |
-
<select id="fRel" aria-label="关系"><option value="">全部关系</option></select>
|
| 135 |
-
<select id="fConf" aria-label="置信度"><option value="">全部置信度</option><option value="high">高</option><option value="medium">中</option><option value="low">低</option></select>
|
| 136 |
-
<select id="fDecl" aria-label="base_model 声明"><option value="">全部声明情况</option><option value="ok">声明正确</option><option value="missing">没写 base_model</option><option value="wrong_base">底模写错</option><option value="wrong_relation">关系写错</option></select>
|
| 137 |
-
<label><input type="checkbox" id="fCopy"> 隐藏整仓复制</label>
|
| 138 |
-
<label><input type="checkbox" id="fUnk"> 只看待确认</label>
|
| 139 |
-
<label><input type="checkbox" id="fNsfw"> 显示 NSFW</label>
|
| 140 |
-
</div>
|
| 141 |
<div class="tablewrap"><table id="repoTable"></table></div>
|
| 142 |
<button class="more" id="moreBtn" hidden>再显示 100 条</button>
|
| 143 |
</section>
|
| 144 |
-
|
| 145 |
-
<section class="card">
|
| 146 |
-
<h2 id="exclTitle">HF 算在这个模型下、但其实不是它的仓库</h2>
|
| 147 |
-
<p class="desc">这些仓库在 HF Model tree 里挂在当前模型下面,但权重或训练信息显示它们属于别的模型。</p>
|
| 148 |
-
<div class="tablewrap"><table id="exclTable"></table></div>
|
| 149 |
-
</section>
|
| 150 |
-
|
| 151 |
-
<section class="card method">
|
| 152 |
-
<h2>口径说明</h2>
|
| 153 |
-
<p><b>找仓库:</b>HF Model tree(逐层往下)、仓库名搜索、模型卡全文搜索、家族标签、调用了官方模型的 Space。故意收得宽,再由分类去掉无关的。</p>
|
| 154 |
-
<p><b>判断属于哪个模型:</b>先看权重本身(与官方文件哈希相同、完整权重里有没有某个成员独有的层,比如 H3 的音频分支和 H3-Image 的 PDD 头、抽查一层权重的数值与官方比对、LoRA 文件头里写的训练底模),这些能直接定案,置信度为"高"。没有这类证据时再看声明的 base_model、模型卡内容、仓库里有没有视频样例、创建时间(早于某个成员发布的仓库不可能基于它),置信度为"中"。只有名字能参考时为"低"。结构证据互相矛盾或分不清是哪个成员的,放进"待确认",不计入任何模型。</p>
|
| 155 |
-
<p><b>衍生模型:</b>LoRA 等适配器、微调、融合、量化、重打包、官方权重转存、配套组件(VAE、文本编码器等)。整仓复制别人社区仓库的,按内容归类并标为"复制"。只是给它用、权重来自别的模型的(比如基于普通 Qwen 的提示词改写模型)算周边工具,不算衍生模型。</p>
|
| 156 |
-
<p><b>每日下载:</b>HF 只公开每个仓库的累计下载和近 30 天下载,所以每天存一次快照,用相邻两天的累计下载相减。新出现的仓库第一天不计。</p>
|
| 157 |
-
<p id="verNote"></p>
|
| 158 |
-
</section>
|
| 159 |
</div>
|
| 160 |
|
| 161 |
<script>
|
| 162 |
-
const REL_NAME = {adapter: "适配器(LoRA 等)", finetune: "微调", quantized: "量化", repackage: "重打包", merge: "融合", mirror: "官方权重转存", component: "配套组件"
|
| 163 |
-
const
|
| 164 |
-
const DECL_NAME = {ok: "正确", missing: "没写", wrong_base: "底模写错", wrong_relation: "关系写错"};
|
| 165 |
-
let LIN_NAME = {unknown: "待确认", unrelated: "无关"};
|
| 166 |
const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();
|
| 167 |
const fmt = n => n == null ? "–" : n >= 1e6 ? (n / 1e6).toFixed(n >= 1e7 ? 1 : 2).replace(/\.?0+$/, "") + "M" : n >= 1e4 ? (n / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : n.toLocaleString("en-US");
|
| 168 |
const full = n => n == null ? "–" : n.toLocaleString("en-US");
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
-
|
| 172 |
-
|
| 173 |
|
| 174 |
fetch("data/index.json").then(r => r.json()).then(idx => {
|
| 175 |
const sel = document.getElementById("famSel");
|
|
@@ -183,198 +150,207 @@ fetch("data/index.json").then(r => r.json()).then(idx => {
|
|
| 183 |
|
| 184 |
function loadFamily(key) {
|
| 185 |
fetch(`data/${key}.json`).then(r => r.json()).then(d => {
|
| 186 |
-
D = d; shown = 100;
|
| 187 |
-
LIN_NAME = {unknown: "待确认", unrelated: "无关"};
|
| 188 |
-
for (const m of d.family.members) LIN_NAME[m.lineage] = m.base.split("/")[1];
|
| 189 |
lineage = d.family.members[0].lineage;
|
| 190 |
document.title = `${d.family.title}开源生态`;
|
| 191 |
document.getElementById("title").textContent = `${d.family.title}开源生态`;
|
| 192 |
-
document.getElementById("asof").textContent = `数据日期 ${d.today}(UTC) · 已记录 ${d.snapshot_days.length} 天快照 · 每天自动更新`;
|
| 193 |
-
document.getElementById("verNote").textContent = `分类规则版本 ${d.classifier_version},生成于 ${d.generated_at.replace("T", " ").replace("+00:00", " UTC")}。`;
|
| 194 |
const seg = document.getElementById("lineageSeg");
|
| 195 |
seg.innerHTML = "";
|
| 196 |
for (const m of d.family.members) {
|
| 197 |
const b = document.createElement("button");
|
| 198 |
-
b.textContent =
|
| 199 |
-
b.onclick = () => { lineage = m.lineage; shown = 100; seg.querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x.dataset.k === lineage)); render(); };
|
| 200 |
seg.appendChild(b);
|
| 201 |
}
|
| 202 |
-
const rs = document.getElementById("fRel");
|
| 203 |
-
rs.innerHTML = `<option value="">全部关系</option>` + [...d.rel_order, "tool", "no-weights", "app", "dataset"].map(k => `<option value="${k}">${REL_NAME[k]}</option>`).join("");
|
| 204 |
if (!inited) {
|
| 205 |
inited = true;
|
| 206 |
-
|
| 207 |
document.getElementById("moreBtn").onclick = () => { shown += 100; renderRepos(); };
|
| 208 |
-
matchMedia("(prefers-color-scheme: dark)").addEventListener("change",
|
| 209 |
-
new MutationObserver(
|
| 210 |
addEventListener("resize", () => Object.values(charts).forEach(c => c.resize()));
|
| 211 |
}
|
| 212 |
render();
|
| 213 |
});
|
| 214 |
}
|
| 215 |
|
| 216 |
-
function render() { renderTiles();
|
| 217 |
-
|
| 218 |
-
function L() { return D.lineages[lineage]; }
|
| 219 |
|
| 220 |
function renderTiles() {
|
| 221 |
-
const l = L()
|
| 222 |
-
const
|
| 223 |
-
|
| 224 |
-
const four = ["adapter", "finetune", "quantized", "merge"].reduce((a, r) => a + ((l.by_relation[r] || {}).n || 0), 0);
|
| 225 |
-
const tiles = [
|
| 226 |
-
{label: "衍生模型", value: full(l.n_models), note: `其中适配器/微调/量化/融合 ${full(four)} 个,HF Model tree 这四类显示 ${full(hf)} 个`, hero: true},
|
| 227 |
-
{label: "衍生模型近 30 天下载", value: fmt(l.dl30), note: `官方仓库 ${fmt(l.official.dl30)}`},
|
| 228 |
-
{label: "衍生模型累计下载", value: fmt(l.dlall), note: `官方仓库 ${fmt(l.official.dlall)}`},
|
| 229 |
-
{label: "用到它的 Space", value: full(l.n_spaces), note: `另有数据集 ${l.n_datasets} 个、周边工具 ${l.n_tools} 个`},
|
| 230 |
-
{label: "base_model 没写或写错", value: full(miss), note: `占衍生模型的 ${l.n_models ? Math.round(miss / l.n_models * 100) : 0}%`},
|
| 231 |
-
];
|
| 232 |
-
document.getElementById("tiles").innerHTML = tiles.map(t => `<div class="tile${t.hero ? " hero" : ""}"><div class="label">${t.label}</div><div class="value">${t.value}</div><div class="note">${t.note}</div></div>`).join("");
|
| 233 |
}
|
| 234 |
|
| 235 |
-
|
| 236 |
-
const html = D.rel_order.filter(r => L().by_relation[r].n > 0).map(r => `<span><i style="background:${relColor(r)}"></i>${REL_NAME[r]}</span>`).join("");
|
| 237 |
-
document.querySelectorAll("[data-legend]").forEach(el => el.innerHTML = html);
|
| 238 |
-
}
|
| 239 |
|
| 240 |
-
function
|
| 241 |
-
return
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
|
|
|
| 250 |
}
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
if (
|
| 255 |
-
return
|
| 256 |
}
|
| 257 |
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
chart(id).setOption(o);
|
| 266 |
}
|
| 267 |
|
| 268 |
-
function
|
| 269 |
-
const
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
}
|
| 276 |
-
|
| 277 |
-
const byRel = {};
|
| 278 |
-
for (const r of D.rel_order) byRel[r] = days.map(d => (l.daily.find(x => x.day === d && x.relation === r) || {}).daily || 0);
|
| 279 |
-
stacked("dailyChart", days, byRel);
|
| 280 |
-
}
|
| 281 |
|
| 282 |
-
|
| 283 |
-
const
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
const xs = Object.keys(weeks).sort();
|
| 288 |
-
if (xs.length) { // fill missing weeks
|
| 289 |
-
const all = []; for (let d = new Date(xs[0] + "T00:00:00Z"); d <= new Date(xs.at(-1) + "T00:00:00Z"); d.setUTCDate(d.getUTCDate() + 7)) all.push(d.toISOString().slice(0, 10));
|
| 290 |
-
xs.splice(0, xs.length, ...all);
|
| 291 |
}
|
| 292 |
-
const
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
}
|
| 296 |
|
| 297 |
-
|
| 298 |
-
const
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
const
|
| 303 |
-
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
}
|
| 306 |
-
|
| 307 |
-
const
|
| 308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
}
|
| 310 |
|
| 311 |
-
|
| 312 |
-
const l = L();
|
| 313 |
-
const rows = D.repos.filter(r => r.lineage === lineage && r.kind === "model" && D.rel_order.includes(r.relation) && r.dl30)
|
| 314 |
-
.sort((a, b) => b.dl30 - a.dl30);
|
| 315 |
-
const top = rows.slice(0, 10).reverse();
|
| 316 |
-
const share = l.dl30 ? rows.slice(0, 1).reduce((a, r) => a + r.dl30, 0) / l.dl30 : 0;
|
| 317 |
-
const share10 = l.dl30 ? rows.slice(0, 10).reduce((a, r) => a + r.dl30, 0) / l.dl30 : 0;
|
| 318 |
-
document.getElementById("concDesc").textContent = rows.length
|
| 319 |
-
? `近 30 天下载。第一名占全部衍生模型下载的 ${Math.round(share * 100)}%,前十名占 ${Math.round(share10 * 100)}%,看总量时要注意头部集中。`
|
| 320 |
-
: "暂无数据。";
|
| 321 |
-
const o = baseOpts();
|
| 322 |
-
o.tooltip = {...o.tooltip, trigger: "item", formatter: p => `${esc(p.name)}<br>${REL_NAME[top[p.dataIndex].relation]} · 近 30 天 ${full(p.value)}`};
|
| 323 |
-
o.grid = {left: 8, right: 64, top: 4, bottom: 4, containLabel: true};
|
| 324 |
-
o.xAxis = {type: "value", show: false};
|
| 325 |
-
o.yAxis = {type: "category", data: top.map(r => r.id), axisLine: {show: false}, axisTick: {show: false},
|
| 326 |
-
axisLabel: {color: css("--ink2"), fontSize: 12.5, width: Math.min(330, document.getElementById("topChart").clientWidth * 0.42), overflow: "truncate"}};
|
| 327 |
-
o.series = [{type: "bar", barMaxWidth: 20, data: top.map(r => ({value: r.dl30, itemStyle: {color: relColor(r.relation), borderRadius: [0, 4, 4, 0]}})),
|
| 328 |
-
label: {show: true, position: "right", color: css("--ink2"), fontSize: 12.5, formatter: p => fmt(p.value)}}];
|
| 329 |
-
chart("topChart").setOption(o);
|
| 330 |
-
}
|
| 331 |
|
| 332 |
-
function
|
| 333 |
-
const
|
| 334 |
-
const
|
| 335 |
-
const
|
| 336 |
-
const
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
|
|
|
| 342 |
}
|
| 343 |
|
| 344 |
function renderRepos() {
|
| 345 |
-
const
|
|
|
|
| 346 |
const x = a[sortKey], y = b[sortKey];
|
| 347 |
return (x == null) - (y == null) || (x < y ? -1 : x > y ? 1 : 0) * sortDir;
|
| 348 |
});
|
| 349 |
-
const
|
| 350 |
-
|
| 351 |
-
let h = "<thead><tr>" + cols.map(([k, n, num]) => `<th class="sortable${num ? " num" : ""}" data-k="${k}">${n}${sortKey === k ? (sortDir < 0 ? " ↓" : " ↑") : ""}</th>`).join("") + "<th>依据</th></tr></thead><tbody>";
|
| 352 |
for (const r of rows.slice(0, shown)) {
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
const sw = D.rel_order.includes(r.relation) ? `<span class="sw" style="background:${relColor(r.relation)}"></span>` : "";
|
| 356 |
-
h += `<tr><td class="repo"><a href="${url}" target="_blank" rel="noopener">${esc(r.id)}</a>${r.copy_of ? ` <span class="chip" title="复制自 ${esc(r.copy_of)}">复制</span>` : ""}${r.flags.includes("nsfw") ? ' <span class="chip">NSFW</span>' : ""}</td>
|
| 357 |
-
<td style="white-space:nowrap">${sw}${REL_NAME[r.relation] || "–"}</td><td>${CONF_NAME[r.conf] || "–"}</td>
|
| 358 |
-
<td class="num">${full(r.dl30)}</td><td class="num">${full(r.dlall)}</td>${hasDaily ? `<td class="num">${full(r.d1)}</td>` : ""}<td style="white-space:nowrap">${r.created}</td><td>${dec}</td>
|
| 359 |
-
<td><details><summary>${r.evidence.length} 条</summary><ul>${r.evidence.map(e => `<li>${esc(e)}</li>`).join("")}</ul></details></td></tr>`;
|
| 360 |
}
|
| 361 |
-
h += "</tbody>";
|
| 362 |
const t = document.getElementById("repoTable");
|
| 363 |
-
t.innerHTML = h;
|
| 364 |
t.querySelectorAll("th.sortable").forEach(th => th.onclick = () => { const k = th.dataset.k; sortDir = sortKey === k ? -sortDir : -1; sortKey = k; renderRepos(); });
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
}
|
| 369 |
|
| 370 |
-
function
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
}
|
| 379 |
</script>
|
| 380 |
</body>
|
|
|
|
| 11 |
--page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
|
| 12 |
--grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10); --wash: #f0efec;
|
| 13 |
--s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
|
| 14 |
+
--accent: #2a78d6; --bar: #6b6a65;
|
| 15 |
}
|
| 16 |
@media (prefers-color-scheme: dark) {
|
| 17 |
:root:not([data-theme="light"]) {
|
| 18 |
color-scheme: dark;
|
| 19 |
--page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
|
| 20 |
+
--grid: #2c2c2a; --axis: #45453f; --ring: rgba(255,255,255,0.10); --wash: #262624;
|
| 21 |
--s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
|
| 22 |
+
--accent: #3987e5; --bar: #a3a29b;
|
| 23 |
}
|
| 24 |
}
|
| 25 |
:root[data-theme="dark"] {
|
| 26 |
color-scheme: dark;
|
| 27 |
--page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
|
| 28 |
+
--grid: #2c2c2a; --axis: #45453f; --ring: rgba(255,255,255,0.10); --wash: #262624;
|
| 29 |
--s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
|
| 30 |
+
--accent: #3987e5; --bar: #a3a29b;
|
| 31 |
}
|
| 32 |
* { box-sizing: border-box; }
|
| 33 |
body { margin: 0; background: var(--page); color: var(--ink);
|
| 34 |
+
font: 16px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
|
| 35 |
+
.wrap { max-width: 1240px; margin: 0 auto; padding: 32px 16px 72px; }
|
| 36 |
+
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
|
| 37 |
+
h1 { font-size: 30px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
|
| 38 |
+
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 3px; }
|
| 39 |
+
.seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 16px; padding: 8px 16px; border-radius: 7px; cursor: pointer; }
|
|
|
|
|
|
|
| 40 |
.seg button[aria-pressed="true"] { background: var(--wash); color: var(--ink); font-weight: 600; }
|
| 41 |
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
| 42 |
+
#famSel { font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 7px 10px; }
|
| 43 |
+
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
|
| 44 |
+
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 18px 20px; min-width: 0; }
|
| 45 |
+
.tile .label { color: var(--ink2); font-size: 16px; }
|
| 46 |
+
.tile .value { font-size: 40px; font-weight: 650; line-height: 1.2; margin-top: 4px; }
|
| 47 |
+
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; min-width: 0; }
|
| 48 |
+
.card h2 { font-size: 20px; margin: 0 0 14px; font-weight: 620; }
|
|
|
|
|
|
|
| 49 |
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
| 50 |
+
.row2.one { grid-template-columns: 1fr; }
|
| 51 |
+
.row2 > * { min-width: 0; }
|
| 52 |
@media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
|
| 53 |
+
@media (max-width: 600px) { .tile .value { font-size: 32px; } .card { padding: 16px 14px; } h1 { font-size: 24px; } }
|
| 54 |
+
.chart { width: 100%; height: 320px; }
|
| 55 |
+
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; font-size: 15px; color: var(--ink2); }
|
| 56 |
+
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
|
| 57 |
+
.treewrap { overflow-x: auto; }
|
| 58 |
+
.tree { display: block; font: 15px system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
|
| 59 |
+
.tree .link { fill: none; stroke: var(--axis); stroke-width: 1.5; }
|
| 60 |
+
.tree text { fill: var(--ink); dominant-baseline: central; }
|
| 61 |
+
.tree .num { fill: var(--ink2); }
|
| 62 |
+
.tree .root { font-size: 16px; font-weight: 650; }
|
| 63 |
+
.tree a:hover .nm { fill: var(--accent); text-decoration: underline; }
|
| 64 |
+
.tree .fold { cursor: pointer; }
|
| 65 |
+
.tree .fold text { fill: var(--accent); }
|
| 66 |
+
.tree .fold:hover text { text-decoration: underline; }
|
| 67 |
+
.tree .fold circle { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
|
| 68 |
+
.tree .fold:focus-visible { outline: 2px solid var(--accent); }
|
| 69 |
+
table { width: 100%; border-collapse: collapse; font-size: 15px; }
|
| 70 |
+
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--grid); }
|
| 71 |
th { color: var(--ink2); font-weight: 560; white-space: nowrap; }
|
| 72 |
th.sortable { cursor: pointer; user-select: none; }
|
| 73 |
th.sortable:hover { color: var(--ink); }
|
| 74 |
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
| 75 |
+
tr.sum td { font-weight: 620; }
|
| 76 |
+
tr.sum + tr td { padding-top: 14px; }
|
| 77 |
.tablewrap { overflow-x: auto; }
|
| 78 |
a { color: var(--accent); text-decoration: none; }
|
| 79 |
a:hover { text-decoration: underline; }
|
| 80 |
+
td.repo { word-break: break-all; }
|
| 81 |
+
#q { font: inherit; font-size: 15px; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 8px 12px; width: 100%; max-width: 420px; margin-bottom: 12px; }
|
| 82 |
+
.more { margin-top: 12px; font: inherit; font-size: 15px; background: var(--wash); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
</style>
|
| 84 |
</head>
|
| 85 |
<body>
|
| 86 |
<div class="wrap">
|
| 87 |
<header>
|
| 88 |
+
<h1 id="title">MiniMax 开源生态</h1>
|
|
|
|
|
|
|
|
|
|
| 89 |
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center">
|
| 90 |
<select id="famSel" aria-label="选择模型家族" hidden></select>
|
| 91 |
<div class="seg" role="group" aria-label="选择模型" id="lineageSeg"></div>
|
|
|
|
| 94 |
|
| 95 |
<div class="tiles" id="tiles"></div>
|
| 96 |
|
| 97 |
+
<section class="card">
|
| 98 |
+
<h2>Model tree(数字为累计下载)</h2>
|
| 99 |
+
<div class="legend" id="treeLegend"></div>
|
| 100 |
+
<div class="treewrap"><svg class="tree" id="tree" role="group" aria-label="衍生关系树"></svg></div>
|
| 101 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
<section class="card">
|
| 104 |
<h2>按关系类型</h2>
|
|
|
|
| 105 |
<div class="tablewrap"><table id="relTable"></table></div>
|
| 106 |
</section>
|
| 107 |
|
| 108 |
+
<div class="row2" id="chartRow">
|
| 109 |
+
<section class="card">
|
| 110 |
+
<h2>每周新增衍生模型</h2>
|
| 111 |
+
<div id="growthChart" class="chart"></div>
|
| 112 |
+
</section>
|
| 113 |
+
<section class="card" id="dailyCard" hidden>
|
| 114 |
+
<h2>衍生模型每日下载</h2>
|
| 115 |
+
<div id="dailyChart" class="chart"></div>
|
| 116 |
+
</section>
|
| 117 |
+
</div>
|
| 118 |
|
| 119 |
<section class="card">
|
| 120 |
+
<h2>全部衍生模型</h2>
|
| 121 |
+
<input type="search" id="q" placeholder="搜索模型名" aria-label="搜索模型名">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
<div class="tablewrap"><table id="repoTable"></table></div>
|
| 123 |
<button class="more" id="moreBtn" hidden>再显示 100 条</button>
|
| 124 |
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
</div>
|
| 126 |
|
| 127 |
<script>
|
| 128 |
+
const REL_NAME = {adapter: "适配器(LoRA 等)", finetune: "微调", quantized: "量化", repackage: "重打包", merge: "融合", mirror: "官方权重转存", component: "配套组件"};
|
| 129 |
+
const HF_RELS = ["adapter", "finetune", "quantized", "merge"]; // the four kinds HF's Model tree has
|
|
|
|
|
|
|
| 130 |
const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();
|
| 131 |
const fmt = n => n == null ? "–" : n >= 1e6 ? (n / 1e6).toFixed(n >= 1e7 ? 1 : 2).replace(/\.?0+$/, "") + "M" : n >= 1e4 ? (n / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : n.toLocaleString("en-US");
|
| 132 |
const full = n => n == null ? "–" : n.toLocaleString("en-US");
|
| 133 |
+
const esc = s => String(s).replace(/[&<>"]/g, c => ({"&": "&", "<": "<", ">": ">", '"': """}[c]));
|
| 134 |
+
const FONT = 'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif';
|
| 135 |
+
let D, lineage, charts = {}, shown = 100, sortKey = "dlall", sortDir = -1, inited = false;
|
| 136 |
+
let open = {}, trees = {};
|
| 137 |
|
| 138 |
+
const relColor = rel => rel === "official" ? "var(--ink)" : `var(--s${D.rel_order.indexOf(rel) + 1})`;
|
| 139 |
+
const L = () => D.lineages[lineage];
|
| 140 |
|
| 141 |
fetch("data/index.json").then(r => r.json()).then(idx => {
|
| 142 |
const sel = document.getElementById("famSel");
|
|
|
|
| 150 |
|
| 151 |
function loadFamily(key) {
|
| 152 |
fetch(`data/${key}.json`).then(r => r.json()).then(d => {
|
| 153 |
+
D = d; shown = 100; open = {}; trees = {};
|
|
|
|
|
|
|
| 154 |
lineage = d.family.members[0].lineage;
|
| 155 |
document.title = `${d.family.title}开源生态`;
|
| 156 |
document.getElementById("title").textContent = `${d.family.title}开源生态`;
|
|
|
|
|
|
|
| 157 |
const seg = document.getElementById("lineageSeg");
|
| 158 |
seg.innerHTML = "";
|
| 159 |
for (const m of d.family.members) {
|
| 160 |
const b = document.createElement("button");
|
| 161 |
+
b.textContent = m.base.split("/")[1]; b.dataset.k = m.lineage; b.setAttribute("aria-pressed", m.lineage === lineage);
|
| 162 |
+
b.onclick = () => { lineage = m.lineage; shown = 100; open = {}; seg.querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x.dataset.k === lineage)); render(); };
|
| 163 |
seg.appendChild(b);
|
| 164 |
}
|
|
|
|
|
|
|
| 165 |
if (!inited) {
|
| 166 |
inited = true;
|
| 167 |
+
document.getElementById("q").addEventListener("input", () => { shown = 100; renderRepos(); });
|
| 168 |
document.getElementById("moreBtn").onclick = () => { shown += 100; renderRepos(); };
|
| 169 |
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", renderCharts);
|
| 170 |
+
new MutationObserver(renderCharts).observe(document.documentElement, {attributes: true, attributeFilter: ["data-theme"]});
|
| 171 |
addEventListener("resize", () => Object.values(charts).forEach(c => c.resize()));
|
| 172 |
}
|
| 173 |
render();
|
| 174 |
});
|
| 175 |
}
|
| 176 |
|
| 177 |
+
function render() { renderTiles(); renderTree(); renderRel(); renderCharts(); renderRepos(); }
|
| 178 |
+
function renderCharts() { renderGrowth(); renderDaily(); }
|
|
|
|
| 179 |
|
| 180 |
function renderTiles() {
|
| 181 |
+
const l = L();
|
| 182 |
+
const tiles = [["衍生模型", full(l.n_models)], ["衍生模型近 30 天下载", fmt(l.dl30)], ["衍生模型累计下载", fmt(l.dlall)]];
|
| 183 |
+
document.getElementById("tiles").innerHTML = tiles.map(([k, v]) => `<div class="tile"><div class="label">${k}</div><div class="value">${v}</div></div>`).join("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
|
| 186 |
+
/* ---------- Model tree ---------- */
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
+
function tree() {
|
| 189 |
+
if (trees[lineage]) return trees[lineage];
|
| 190 |
+
const l = L(), node = new Map();
|
| 191 |
+
node.set(l.base, {id: l.base, rel: "official", dlall: l.official.dlall || 0, kids: []});
|
| 192 |
+
const rows = D.repos.filter(r => r.lin === lineage);
|
| 193 |
+
for (const r of rows) node.set(r.id, {id: r.id, rel: r.rel, dlall: r.dlall || 0, kids: []});
|
| 194 |
+
for (const r of rows) (node.get(r.up) || node.get(l.base)).kids.push(node.get(r.id));
|
| 195 |
+
const sub = n => n.sub ??= n.dlall + n.kids.reduce((a, k) => a + sub(k), 0);
|
| 196 |
+
sub(node.get(l.base));
|
| 197 |
+
for (const n of node.values()) n.kids.sort((a, b) => b.sub - a.sub || a.id.localeCompare(b.id));
|
| 198 |
+
return trees[lineage] = node.get(l.base);
|
| 199 |
}
|
| 200 |
|
| 201 |
+
// How many children a node shows: the root its top 12, others their top 4 that have downloads.
|
| 202 |
+
function nShown(n, depth) {
|
| 203 |
+
if (open[n.id] != null) return open[n.id];
|
| 204 |
+
return Math.min(depth === 0 ? 12 : 4, n.kids.filter(c => c.sub > 0).length);
|
| 205 |
}
|
| 206 |
|
| 207 |
+
const ROW = 38, RMAX = 13, PAD_LABEL = 10, NUM_DX = 10;
|
| 208 |
+
const indent = () => innerWidth < 600 ? 28 : 46;
|
| 209 |
+
let measureCtx;
|
| 210 |
+
function textW(s, font) {
|
| 211 |
+
measureCtx ||= document.createElement("canvas").getContext("2d");
|
| 212 |
+
measureCtx.font = font;
|
| 213 |
+
return measureCtx.measureText(s).width;
|
|
|
|
| 214 |
}
|
| 215 |
|
| 216 |
+
function renderTree() {
|
| 217 |
+
const root = tree(), items = [];
|
| 218 |
+
let row = 0;
|
| 219 |
+
const maxDl = Math.max(1, root.dlall, ...root.kids.map(k => k.dlall), ...D.repos.filter(r => r.lin === lineage).map(r => r.dlall || 0));
|
| 220 |
+
const rad = dl => 3.5 + (RMAX - 3.5) * Math.sqrt((dl || 0) / maxDl);
|
| 221 |
+
// One row per node, children below their parent and indented one step: full names fit at
|
| 222 |
+
// any depth and on a phone, and every link is a short elbow from parent to child.
|
| 223 |
+
function walk(n, d) {
|
| 224 |
+
const k = nShown(n, d), rest = n.kids.slice(k);
|
| 225 |
+
const it = {n, d, kids: [], y: row++};
|
| 226 |
+
items.push(it);
|
| 227 |
+
for (const c of n.kids.slice(0, k)) it.kids.push(walk(c, d + 1));
|
| 228 |
+
if (rest.length) {
|
| 229 |
+
const f = {fold: true, n, d: d + 1, label: `其余 ${full(rest.length)} 个 · ${fmt(rest.reduce((a, c) => a + c.sub, 0))}`, kids: [], y: row++};
|
| 230 |
+
items.push(f); it.kids.push(f);
|
| 231 |
+
}
|
| 232 |
+
return it;
|
| 233 |
}
|
| 234 |
+
walk(root, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
+
const f15 = `15px ${FONT}`, fRoot = `650 16px ${FONT}`;
|
| 237 |
+
for (const it of items) {
|
| 238 |
+
if (it.fold) { it.w = textW(it.label, f15); continue; }
|
| 239 |
+
it.num = fmt(it.n.dlall);
|
| 240 |
+
it.w = textW(it.n.id, it.d === 0 ? fRoot : f15) + NUM_DX + textW(it.num, f15);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
}
|
| 242 |
+
const INDENT = indent(), cx = d => 4 + RMAX + d * INDENT, lx = d => cx(d) + RMAX + PAD_LABEL;
|
| 243 |
+
const Y = y => 6 + y * ROW + ROW / 2;
|
| 244 |
+
const r = it => it.fold ? 5 : rad(it.n.dlall);
|
|
|
|
| 245 |
|
| 246 |
+
let links = "", nodes = "";
|
| 247 |
+
for (const it of items) {
|
| 248 |
+
if (!it.kids.length) continue;
|
| 249 |
+
const x = cx(it.d), last = it.kids.at(-1);
|
| 250 |
+
links += `M${x},${Y(it.y) + r(it) + 2}V${Y(last.y)}`;
|
| 251 |
+
for (const k of it.kids) links += `M${x},${Y(k.y)}H${cx(k.d) - r(k) - 3}`;
|
| 252 |
+
}
|
| 253 |
+
for (const it of items) {
|
| 254 |
+
const y = Y(it.y), d = it.d;
|
| 255 |
+
if (it.fold) {
|
| 256 |
+
nodes += `<g class="fold" tabindex="0" role="button" data-id="${esc(it.n.id)}"><circle cx="${cx(d)}" cy="${y}" r="5"/><text x="${lx(d)}" y="${y}">${esc(it.label)}</text></g>`;
|
| 257 |
+
continue;
|
| 258 |
+
}
|
| 259 |
+
const n = it.n;
|
| 260 |
+
nodes += `<circle cx="${cx(d)}" cy="${y}" r="${rad(n.dlall).toFixed(1)}" style="fill:${relColor(n.rel)}"/>`
|
| 261 |
+
+ `<a href="https://huggingface.co/${esc(n.id)}" target="_blank" rel="noopener"><text x="${lx(d)}" y="${y}"${d === 0 ? ' class="root"' : ""}>`
|
| 262 |
+
+ `<tspan class="nm">${esc(n.id)}</tspan><tspan class="num" dx="${NUM_DX}">${it.num}</tspan></text></a>`;
|
| 263 |
}
|
| 264 |
+
const svg = document.getElementById("tree");
|
| 265 |
+
const W = Math.ceil(Math.max(...items.map(i => lx(i.d) + i.w)) + 12), H = Math.ceil(Y(row - 1) + ROW / 2 + 6);
|
| 266 |
+
svg.setAttribute("width", W); svg.setAttribute("height", H); svg.setAttribute("viewBox", `0 0 ${W} ${H}`);
|
| 267 |
+
svg.innerHTML = `<path class="link" d="${links}"/>${nodes}`;
|
| 268 |
+
svg.querySelectorAll(".fold").forEach(g => {
|
| 269 |
+
const go = () => {
|
| 270 |
+
const it = items.find(i => !i.fold && i.n.id === g.dataset.id);
|
| 271 |
+
open[it.n.id] = nShown(it.n, it.d) + (it.d === 0 ? 20 : 10);
|
| 272 |
+
renderTree();
|
| 273 |
+
};
|
| 274 |
+
g.onclick = go;
|
| 275 |
+
g.onkeydown = e => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); go(); } };
|
| 276 |
+
});
|
| 277 |
+
const present = new Set(D.repos.filter(r => r.lin === lineage).map(r => r.rel));
|
| 278 |
+
document.getElementById("treeLegend").innerHTML = D.rel_order.filter(r => present.has(r))
|
| 279 |
+
.map(r => `<span><i style="background:${relColor(r)}"></i>${REL_NAME[r]}</span>`).join("");
|
| 280 |
}
|
| 281 |
|
| 282 |
+
/* ---------- tables ---------- */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
+
function renderRel() {
|
| 285 |
+
const l = L(), b = l.by_relation, hf = l.hf_tree;
|
| 286 |
+
const row = (name, n, h, d30, da, cls = "") => `<tr${cls ? ` class="${cls}"` : ""}><td>${name}</td><td class="num">${full(n)}</td><td class="num">${h == null ? "—" : full(h)}</td><td class="num">${full(d30)}</td><td class="num">${full(da)}</td></tr>`;
|
| 287 |
+
const sum = (rels, k) => rels.reduce((a, r) => a + b[r][k], 0);
|
| 288 |
+
const extra = D.rel_order.filter(r => !HF_RELS.includes(r));
|
| 289 |
+
let h = `<thead><tr><th>关系</th><th class="num">识别到</th><th class="num">HF Model tree 显示</th><th class="num">近 30 天下载</th><th class="num">累计下载</th></tr></thead><tbody>`;
|
| 290 |
+
for (const r of HF_RELS) h += row(REL_NAME[r], b[r].n, hf[r] || 0, b[r].dl30, b[r].dlall);
|
| 291 |
+
h += row("小计", sum(HF_RELS, "n"), HF_RELS.reduce((a, r) => a + (hf[r] || 0), 0), sum(HF_RELS, "dl30"), sum(HF_RELS, "dlall"), "sum");
|
| 292 |
+
for (const r of extra) h += row(REL_NAME[r], b[r].n, null, b[r].dl30, b[r].dlall);
|
| 293 |
+
h += row("合计", l.n_models, null, l.dl30, l.dlall, "sum");
|
| 294 |
+
document.getElementById("relTable").innerHTML = h + "</tbody>";
|
| 295 |
}
|
| 296 |
|
| 297 |
function renderRepos() {
|
| 298 |
+
const q = document.getElementById("q").value.trim().toLowerCase();
|
| 299 |
+
const rows = D.repos.filter(r => r.lin === lineage && (!q || r.id.toLowerCase().includes(q))).sort((a, b) => {
|
| 300 |
const x = a[sortKey], y = b[sortKey];
|
| 301 |
return (x == null) - (y == null) || (x < y ? -1 : x > y ? 1 : 0) * sortDir;
|
| 302 |
});
|
| 303 |
+
const cols = [["id", "模型"], ["rel", "关系"], ["dl30", "近 30 天下载", 1], ["dlall", "累计下载", 1], ...(D.snapshot_days.length > 1 ? [["d1", "最近一天", 1]] : [])];
|
| 304 |
+
let h = "<thead><tr>" + cols.map(([k, n, num]) => `<th class="sortable${num ? " num" : ""}" data-k="${k}">${n}${sortKey === k ? (sortDir < 0 ? " ↓" : " ↑") : ""}</th>`).join("") + "</tr></thead><tbody>";
|
|
|
|
| 305 |
for (const r of rows.slice(0, shown)) {
|
| 306 |
+
h += `<tr><td class="repo"><a href="https://huggingface.co/${esc(r.id)}" target="_blank" rel="noopener">${esc(r.id)}</a></td><td style="white-space:nowrap">${REL_NAME[r.rel]}</td>`
|
| 307 |
+
+ `<td class="num">${full(r.dl30)}</td><td class="num">${full(r.dlall)}</td>${cols.length > 4 ? `<td class="num">${full(r.d1)}</td>` : ""}</tr>`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
}
|
|
|
|
| 309 |
const t = document.getElementById("repoTable");
|
| 310 |
+
t.innerHTML = h + "</tbody>";
|
| 311 |
t.querySelectorAll("th.sortable").forEach(th => th.onclick = () => { const k = th.dataset.k; sortDir = sortKey === k ? -sortDir : -1; sortKey = k; renderRepos(); });
|
| 312 |
+
document.getElementById("moreBtn").hidden = rows.length <= shown;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
/* ---------- charts ---------- */
|
| 316 |
+
|
| 317 |
+
function chart(id) {
|
| 318 |
+
if (charts[id]) { charts[id].dispose(); delete charts[id]; }
|
| 319 |
+
return charts[id] = echarts.init(document.getElementById(id), null, {renderer: "svg"});
|
| 320 |
}
|
| 321 |
|
| 322 |
+
function bars(id, xs, ys, tip) {
|
| 323 |
+
chart(id).setOption({
|
| 324 |
+
animation: false, textStyle: {fontFamily: FONT},
|
| 325 |
+
grid: {left: 8, right: 16, top: 14, bottom: 4, containLabel: true},
|
| 326 |
+
tooltip: {trigger: "axis", axisPointer: {type: "shadow", shadowStyle: {color: css("--wash")}},
|
| 327 |
+
backgroundColor: css("--surface"), borderColor: css("--ring"), textStyle: {color: css("--ink"), fontSize: 15},
|
| 328 |
+
formatter: p => tip(p[0].dataIndex)},
|
| 329 |
+
xAxis: {type: "category", data: xs, axisLine: {lineStyle: {color: css("--axis")}}, axisTick: {show: false}, axisLabel: {color: css("--ink2"), fontSize: 14}},
|
| 330 |
+
yAxis: {type: "value", splitLine: {lineStyle: {color: css("--grid")}}, axisLabel: {color: css("--ink2"), fontSize: 14, formatter: v => fmt(v)}},
|
| 331 |
+
series: [{type: "bar", data: ys, barMaxWidth: 22, itemStyle: {color: css("--bar"), borderRadius: [4, 4, 0, 0]}, emphasis: {disabled: true}}],
|
| 332 |
+
});
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
function renderGrowth() {
|
| 336 |
+
const wk = s => { const d = new Date(s + "T00:00:00Z"); d.setUTCDate(d.getUTCDate() - (d.getUTCDay() + 6) % 7); return d.toISOString().slice(0, 10); };
|
| 337 |
+
const weeks = {};
|
| 338 |
+
for (const g of L().growth) weeks[wk(g.date)] = (weeks[wk(g.date)] || 0) + g.n;
|
| 339 |
+
const keys = Object.keys(weeks).sort(), xs = [];
|
| 340 |
+
// Only finished weeks: the current one would show as a drop.
|
| 341 |
+
const end = new Date(wk(D.today) + "T00:00:00Z");
|
| 342 |
+
if (keys.length) for (let d = new Date(keys[0] + "T00:00:00Z"); d < end; d.setUTCDate(d.getUTCDate() + 7)) xs.push(d.toISOString().slice(0, 10));
|
| 343 |
+
const ys = xs.map(w => weeks[w] || 0);
|
| 344 |
+
bars("growthChart", xs.map(x => x.slice(5)), ys, i => `${xs[i]} 起一周:新增 ${full(ys[i])} 个`);
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
function renderDaily() {
|
| 348 |
+
const daily = L().daily, card = document.getElementById("dailyCard");
|
| 349 |
+
card.hidden = daily.length === 0;
|
| 350 |
+
document.getElementById("chartRow").classList.toggle("one", card.hidden);
|
| 351 |
+
if (card.hidden) { if (charts.dailyChart) { charts.dailyChart.dispose(); delete charts.dailyChart; } return; }
|
| 352 |
+
bars("dailyChart", daily.map(r => r.day.slice(5)), daily.map(r => r.n), i => `${daily[i].day}:${full(daily[i].n)} 次下载`);
|
| 353 |
+
if (charts.growthChart) charts.growthChart.resize();
|
| 354 |
}
|
| 355 |
</script>
|
| 356 |
</body>
|
labels/h3/latest.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c49a3e52b9be6b440d916ceacbd1bdd55382018fc99430a43b22b2527d749379
|
| 3 |
+
size 169348
|