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|
+
全部权重(**63 个文件 / 413.3 GB**)已从项目目录移出,备份在
|
| 6 |
+
`/nfs/yinhanzhang/checkpoint-backup/`,按原相对路径存放(与项目同一文件系统,`rename` 移动,不额外占空间)。
|
| 7 |
+
项目内保留配置类小文件(`config.json`、`*.safetensors.index.json`、`README.md`、`.gitattributes`、
|
| 8 |
+
`adapter_config.json`、tokenizer 配置等),模型目录结构由脚本自动创建。
|
| 9 |
+
|
| 10 |
+
- `weights_manifest.json`:逐文件登记原路径、来源 URL、精确字节数、备份路径
|
| 11 |
+
- `download_weights.py`:恢复脚本,仅依赖 Python 标准库 + `curl`
|
| 12 |
+
- 所有来源均已用 HuggingFace API / HTTP HEAD 核对过文件名与字节数
|
| 13 |
+
|
| 14 |
+
## 1. 六个子项目的权重来源
|
| 15 |
+
|
| 16 |
+
| 项目 | 本地权重目录 | 下载来源 | 大小 | 组 id |
|
| 17 |
+
|---|---|---|---|---|
|
| 18 |
+
| JoyAI-Echo | `echo_wm/checkpoints/` | `Echo-Team/Echo-WM`(base / flash 两个 44.5GB safetensors) | 89.0 GB | `echo-wm` |
|
| 19 |
+
| JoyAI-Echo | `echo_wm/checkpoints/gemma-3/` | `google/gemma-3-12b-it-qat-q4_0-unquantized`(**gated**) | 22.7 GB | `echo-wm-gemma` |
|
| 20 |
+
| lingbot-world-v2 | `ckpt/` | `robbyant/lingbot-world-v2-14b-causal-fast` | 80.1 GB | `lingbot-v2` |
|
| 21 |
+
| WorldKV | `lingbot-world-base-cam/` | `robbyant/lingbot-world-base-cam` | 149.2 GB | `worldkv-base-cam` |
|
| 22 |
+
| WorldKV | `lingbot-world-base-cam/lingbot_world_fast/` | `robbyant/lingbot-world-fast` | 69.1 GB | `worldkv-fast` |
|
| 23 |
+
| dymemv2 | `evaluation/models/`、`evaluation/utils/weights/`、`evaluation/VBench/.../nudenet/` | VBench / DreamSim 评估权重,见下表 | 3.2 GB | `dymemv2-*` |
|
| 24 |
+
|
| 25 |
+
dymemv2 的评估权重来源:
|
| 26 |
+
|
| 27 |
+
| 文件 | 来源 |
|
| 28 |
+
|---|---|
|
| 29 |
+
| `models/checkpoints/cotracker2.pth` | HF `facebook/cotracker` → `cotracker2.pth` |
|
| 30 |
+
| `models/checkpoints/dino_vitbase16_pretrain.pth` | DINO 官方 `https://dl.fbaipublicfiles.com/dino/dino_vitbase16_pretrain/dino_vitbase16_pretrain.pth` |
|
| 31 |
+
| `models/{clip,open_clip}_vitb16_pretrain.pth.tar`、`models/dino_vitb16_pretrain.pth`、`models/ensemble_lora/adapter_model.safetensors` | HF `meituan-longcat/WBench-weights` 的 `dreamsim/` 目录;官方原始包为 GitHub release `ssundaram21/dreamsim` → `v0.2.0-checkpoints/dreamsim_ensemble_checkpoint.zip`(本地 `models/pretrained.zip` 即该文件,内容已解压,故标为 optional) |
|
| 32 |
+
| `utils/weights/i3d_pretrained_400.pt` | HF `Xiaodong/FVD_I3D` → `i3d_pretrained_400.pt` |
|
| 33 |
+
| `VBench/.../nudenet/best.onnx` | HF `vladmandic/nudenet` → `nudenet.onnx`(本地改名为 `best.onnx`) |
|
| 34 |
+
|
| 35 |
+
**项目内没有权重文件的两个项目**(因此无需移动,需要运行时按官方说明下载):
|
| 36 |
+
|
| 37 |
+
- `HY-WorldPlay`:官方脚本 `python download_models.py --hf_token <token>`,依赖
|
| 38 |
+
`tencent/HY-WorldPlay`、`tencent/HunyuanVideo-1.5`(480P-I2V)、`Qwen/Qwen2.5-VL-7B-Instruct`、
|
| 39 |
+
`google/byt5-small`、`AI-ModelScope/Glyph-SDXL-v2`、`black-forest-labs/FLUX.1-Redux-dev`(gated)。
|
| 40 |
+
详见 `HY-WorldPlay/README.md` 的 "Download All Required Models"。
|
| 41 |
+
- `lingbot-world`:官方仓库 README 指向 `robbyant/lingbot-world-base-cam` 与
|
| 42 |
+
`robbyant/lingbot-world-fast`(ModelScope: `Robbyant/...`);本项目目录里只有推理输出,
|
| 43 |
+
实际权重在 `WorldKV/lingbot-world-base-cam/`。
|
| 44 |
+
|
| 45 |
+
## 2. 官方等价下载命令
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
pip install "huggingface_hub[cli]"
|
| 49 |
+
|
| 50 |
+
hf download Echo-Team/Echo-WM --local-dir checkpoints
|
| 51 |
+
hf download google/gemma-3-12b-it-qat-q4_0-unquantized --local-dir checkpoints/gemma-3 # gated
|
| 52 |
+
huggingface-cli download robbyant/lingbot-world-v2-14b-causal-fast --local-dir ./ckpt
|
| 53 |
+
huggingface-cli download robbyant/lingbot-world-base-cam --local-dir ./lingbot-world-base-cam
|
| 54 |
+
huggingface-cli download robbyant/lingbot-world-fast --local-dir ./lingbot-world-base-cam/lingbot_world_fast
|
| 55 |
+
wget https://huggingface.co/facebook/cotracker/resolve/main/cotracker2.pth
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
上面的目标目录与本项目路径不完全一致,直接用本脚本 `--mode download` 会按清单放回项目内的正确位置。
|
| 59 |
+
|
| 60 |
+
## 3. 恢复脚本用法
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
# 查看各组状态(项目内 / 备份内是否齐全、大小是否正确)
|
| 64 |
+
python download_weights.py --mode verify
|
| 65 |
+
|
| 66 |
+
# 查看来源明细
|
| 67 |
+
python download_weights.py --mode list
|
| 68 |
+
|
| 69 |
+
# 上传 HF 前:把权重从项目移到 /nfs/yinhanzhang/checkpoint-backup
|
| 70 |
+
python download_weights.py --mode stash
|
| 71 |
+
|
| 72 |
+
# 本机继续跑实验:从备份秒级恢复(硬链接,不额外占空间)
|
| 73 |
+
python download_weights.py --mode restore
|
| 74 |
+
|
| 75 |
+
# 换机器 / 没有备份:按登记的开源来源重新下载(支持断点续传、并发、大小校验)
|
| 76 |
+
python download_weights.py --mode download --jobs 2
|
| 77 |
+
python download_weights.py --mode download --only echo-wm # 只恢复某一组
|
| 78 |
+
python download_weights.py --mode download --token hf_xxx # gemma-3 gated 仓库需要
|
| 79 |
+
python download_weights.py --mode download --dry-run # 只打印将要下载的内容
|
| 80 |
+
|
| 81 |
+
# 从本地文件重新生成清单
|
| 82 |
+
python download_weights.py --mode manifest
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
常用参数:`--only <组id或项目名>`(可重复)、`--backup-dir <路径>`、`--dry-run`、
|
| 86 |
+
`--copy`(restore 时用复制代替硬链接)、`--include-optional`(下载 optional 的 `pretrained.zip`)、
|
| 87 |
+
`--force`(忽略已存在文件重新下载)。`HF_TOKEN` 环境变量等价于 `--token`。
|
| 88 |
+
|
| 89 |
+
## 4. 注意事项
|
| 90 |
+
|
| 91 |
+
- `google/gemma-3-12b-it-qat-q4_0-unquantized` 是 gated 仓库,需先在 HF 上同意许可,再用
|
| 92 |
+
`--token` 下载;必须保持 **unquantized** 版本,编码器以 bf16 运行。
|
| 93 |
+
- 下载按 `weights_manifest.json` 中的字节数校验,失败会保留 `.part` 文件供续传。
|
| 94 |
+
- 未移动(不是权重,但体积大,上传前建议另行处理):
|
| 95 |
+
`lingbot-world-v2/cases_0923.zip`(8.9 GB)、`com_case.zip`、`more_case 2.zip` 等数据压缩包;
|
| 96 |
+
各项目 `output*/`、`results/`、`checkpoints/../outputs` 等实验输出视频;pose `.npz`;日志。
|
| 97 |
+
- 项目内还有约 2276 个符号链接指向 `/nfs/yinhanzhang/Orignial_Code/...`(推理结果视频),
|
| 98 |
+
上传 HuggingFace 后会断链,上传前需删除、实体化或排除。
|
| 99 |
+
- `.git` 元数据已在上一步清理,各仓库 remote / commit / 本地改动记录在 `GIT_RESTORE_INFO.md`。
|
| 100 |
+
|
| 101 |
+
## 5. 数据压缩包与符号链接排除
|
| 102 |
+
|
| 103 |
+
三个非权重的数据压缩包(都在 `lingbot-world-v2/`,合计约 9.5 GiB / 10.18 GB):
|
| 104 |
+
|
| 105 |
+
| 文件 | 大小 |
|
| 106 |
+
|---|---|
|
| 107 |
+
| `lingbot-world-v2/cases_0923.zip` | 9145.6 MiB(8.93 GiB) |
|
| 108 |
+
| `lingbot-world-v2/com_case.zip` | 282.4 MiB |
|
| 109 |
+
| `lingbot-world-v2/more_case 2.zip` | 280.1 MiB |
|
| 110 |
+
| **合计** | 9708.1 MiB = 9.48 GiB ≈ 10.18 GB(十进制) |
|
| 111 |
+
|
| 112 |
+
它们是评测用例数据,不是模型权重,因此没有移到 `checkpoint-backup`;上传前单独决定是否保留。
|
| 113 |
+
|
| 114 |
+
### 排除清单 `hf_exclude_symlinks.txt`
|
| 115 |
+
|
| 116 |
+
逐行列出 2276 个符号链接的项目内相对路径(无通配符、无空格),可直接用于
|
| 117 |
+
`zip -x@` / `tar --exclude-from` / `rsync --exclude-from`。已验证覆盖 2276/2276 个链接;
|
| 118 |
+
`tar --exclude-from` 对比测试中,打包条目数正好减少对应目录的链接数。
|
| 119 |
+
|
| 120 |
+
这些链接**全部是断链**(目标已不存在):
|
| 121 |
+
|
| 122 |
+
- 490 个指向 `/nfs/yinhanzhang/Orignial_Code/...`
|
| 123 |
+
- 1786 个指向 `/nfs/yinhanzhang/dymemv2/...`(旧项目根路径,现项目位于 `GraphMem/dymemv2`)
|
| 124 |
+
|
| 125 |
+
链接集中在各项目的 `.../_vbench_long/` 评估目录。本地链接保留,打包时排除即可:
|
| 126 |
+
|
| 127 |
+
```bash
|
| 128 |
+
cd /nfs/yinhanzhang/GraphMem
|
| 129 |
+
zip -r -q /nfs/yinhanzhang/code_backup/dymemv2.zip dymemv2 -x@hf_exclude_symlinks.txt
|
| 130 |
+
# 其余项目同理;tar / rsync 用 --exclude-from=hf_exclude_symlinks.txt
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
如需从项目内彻底移除这些断链(可用清单逐条删除,不可逆):
|
| 134 |
+
`while IFS= read -r p; do [ -L "$p" ] && rm -- "$p"; done < hf_exclude_symlinks.txt`
|
| 135 |
+
|
| 136 |
+
### 打包前必须注意
|
| 137 |
+
|
| 138 |
+
- `note.md` 含 HuggingFace token 明文,**不要打进任何上传包**;建议立即在 HF 撤销并轮换该 token。
|
| 139 |
+
- 当前磁盘几乎写满:`/` 仅剩约 152 MB,`/nfs`(Lustre 50T)显示 0 可用。项目本体约 97 GB,
|
| 140 |
+
生成 zip 需要等量空间,执行打包前须先腾出空间,或改用流式打包 / 分批上传。
|