saladday1 commited on
Commit
6e42356
·
verified ·
1 Parent(s): 9f66d08

classifier 2026-11-17.7 + labels

Browse files
code/hfeco/classify.py CHANGED
@@ -16,7 +16,7 @@ import re
16
 
17
  import numpy as np
18
 
19
- VERSION = "2026-11-17.6"
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)
@@ -25,13 +25,16 @@ LORA_KEY = re.compile(r"lora_[ABab]\b|lora_down|lora_up|lora\.(down|up)|\.lokr_|
25
  re.I)
26
  QUANT_NAME = re.compile(r"fp8|int8|int4|int6|nf4|nvfp4|mxfp|fp4|w4a\d|w6a8|w8a8|gptq|awq|svdq|nunchaku|"
27
  r"q[2-8]_[0k]|q[2-8]_k|iq[1-4]|bnb|sdnq|convrot|[2-8]-?bit\b|gguf|exl2|hqq|quant", re.I)
28
- MERGE_NAME = re.compile(r"merge|merged|mix\b|mixed|fused|\bfuse\b|blend|hybrid|graft", re.I)
29
  REPACK_NAME = re.compile(r"comfy|diffusers|single[-_ ]?file|repack|split|bf16|fp16|fp32|pruned|mlx", re.I)
30
  TUNED_NAME = re.compile(r"finetun|fine-tun|\bft\b|turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|fast|"
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|\beros\b|xxx|uncensor", re.I)
 
 
 
35
  LORA_NAME = re.compile(r"lora|lycoris|locon|loha|lokr|adapter", re.I)
36
  AUTHORS = {} # family key -> authors who publish family repos (filled by classify_all)
37
  COMMUNITY = {} # family key -> weight-file index over all probed repos (for whole-repo copies)
@@ -322,7 +325,7 @@ def relation(r, ev, is_lora, is_family_weights, is_text_llm, mirror, pm, name, E
322
  bm = card.get("base_model")
323
  multi = [b for b in bm if isinstance(b, str)] if isinstance(bm, list) else []
324
  same = pm and pm[1] < SAME
325
- meta_merge = bool(re.search(r"merg|graft", json.dumps(ev.get("st_meta") or {}), re.I))
326
  if (card.get("base_model_relation") == "merge" or len(multi) >= 2 or meta_merge or MERGE_NAME.search(name)
327
  or any(p.startswith("merge:") for p in r["hf_parents"])) and not (same and not MERGE_NAME.search(name)):
328
  return "merge"
 
16
 
17
  import numpy as np
18
 
19
+ VERSION = "2026-11-17.7"
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)
 
25
  re.I)
26
  QUANT_NAME = re.compile(r"fp8|int8|int4|int6|nf4|nvfp4|mxfp|fp4|w4a\d|w6a8|w8a8|gptq|awq|svdq|nunchaku|"
27
  r"q[2-8]_[0k]|q[2-8]_k|iq[1-4]|bnb|sdnq|convrot|[2-8]-?bit\b|gguf|exl2|hqq|quant", re.I)
28
+ MERGE_NAME = re.compile(r"merge|merged|mix\b|fused|\bfuse\b|blend|hybrid|graft", re.I) # not "mixed": mixed precision
29
  REPACK_NAME = re.compile(r"comfy|diffusers|single[-_ ]?file|repack|split|bf16|fp16|fp32|pruned|mlx", re.I)
30
  TUNED_NAME = re.compile(r"finetun|fine-tun|\bft\b|turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|fast|"
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|\beros\b|xxx|uncensor", re.I)
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)
38
  LORA_NAME = re.compile(r"lora|lycoris|locon|loha|lokr|adapter", re.I)
39
  AUTHORS = {} # family key -> authors who publish family repos (filled by classify_all)
40
  COMMUNITY = {} # family key -> weight-file index over all probed repos (for whole-repo copies)
 
325
  bm = card.get("base_model")
326
  multi = [b for b in bm if isinstance(b, str)] if isinstance(bm, list) else []
327
  same = pm and pm[1] < SAME
328
+ meta_merge = bool(META_MERGE.search(json.dumps(ev.get("st_meta") or {})))
329
  if (card.get("base_model_relation") == "merge" or len(multi) >= 2 or meta_merge or MERGE_NAME.search(name)
330
  or any(p.startswith("merge:") for p in r["hf_parents"])) and not (same and not MERGE_NAME.search(name)):
331
  return "merge"
code/octo-hf/README.md CHANGED
@@ -27,9 +27,13 @@ Repo 主表每行一个仓库,去重键沿用 `repo_url + reason`:
27
 
28
  - 分类置信度为"高"(有结构证据:权重文件哈希、独有的层、权重数值、训练元数据)
29
  - 累计下载 ≥ 100(`--min-downloads`)
30
- - 不带 NSFW 标记,没有设访问限制
 
 
31
  - 每天最多 20 个(`--limit`),按近 30 天下载从高到低
32
 
 
 
33
  ## PR 内容
34
 
35
  标题 `Add base_model metadata` 或 `Fix base_model metadata`。正文三句:改了什么、为什么认为它基于这个底模(取分类依据里最硬的两条)、只改了 YAML 头可以随时关掉。示例:
 
27
 
28
  - 分类置信度为"高"(有结构证据:权重文件哈希、独有的层、权重数值、训练元数据)
29
  - 累计下载 ≥ 100(`--min-downloads`)
30
+ - 不带 NSFW 标记,没有设访问限制,不是整仓复制别人的仓库
31
+ - 已经声明了社区父模型的不提(比如 `PrunaAI/P-H3-Image-Comfy` 声明了 `PrunaAI/p-h3-image`),只给链条源头提;否则 HF 会把"社区父模型 + 官方底模"当成融合
32
+ - `hf-base-model-relation` 默认不提(`--include-relation` 打开):关系是作者自己选的,我们在这类上也更容易错
33
  - 每天最多 20 个(`--limit`),按近 30 天下载从高到低
34
 
35
+ 2026-11-17 的数据按这些条件有 58 个候选,都是"没写 base_model"。
36
+
37
  ## PR 内容
38
 
39
  标题 `Add base_model metadata` 或 `Fix base_model metadata`。正文三句:改了什么、为什么认为它基于这个底模(取分类依据里最硬的两条)、只改了 YAML 头可以随时关掉。示例:
labels/h3/latest.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e25a4e9d06e7e368d7295c24bf0eaebb8b37eeaa51223d487869fea50a025016
3
  size 169338
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d48ca1ad3fffeabf2165b28ec1e160ee4ac9d5ccbb9cd095b45521f012e15e11
3
  size 169338