|
Download code/docs/INFERENCE.md from luyu1021/turbot2va-ltx2: direct link, hf CLI and curl.
- Browser
- Download file 4.24 kB
-
https://huggingface.co/luyu1021/turbot2va-ltx2/resolve/main/code/docs/INFERENCE.md
- Command line
-
hf download hf://luyu1021/turbot2va-ltx2/code/docs/INFERENCE.md
-
curl -L -o INFERENCE.md https://huggingface.co/luyu1021/turbot2va-ltx2/resolve/main/code/docs/INFERENCE.md
4.24 kB
| # 已有 generator 推理参考的下载与使用 | |
| 本指南针对 `inference/published_turbot2av_main/model.pth`。仓库中的实际发布范围见 HF 根模型卡和 `CHECKSUMS.json`;完整 DCP 训练快照另见 [CHECKPOINTS.md](CHECKPOINTS.md),15 份筛选快照已全部上传并核验。 | |
| ## 文件与来源 | |
| | 项目 | 值 | | |
| | --- | --- | | |
| | HF 模型仓库 | `luyu1021/turbot2va-ltx2` | | |
| | 推理文件 | `inference/published_turbot2av_main/model.pth` | | |
| | 原文件大小 | 37,753,515,845 bytes,约 37.75 GB / 35.16 GiB | | |
| | 参数精度 | BF16 | | |
| | tensor 数量 | 3510 | | |
| | 参数数量 | 18,876,174,592 | | |
| | 内容 | generator;没有 critic、optimizer、scheduler 或 rank RNG | | |
| | 元数据标签 | `stage_3_rcm_scm1_dmd1`,step 3500 | | |
| | SHA256 | `ef31ea8334cc02c8f65da8c5c66b634eb594bca4a827b5cbbd72d390ffe27c61` | | |
| 随附 `checkpoint_info.json` 和 `RELEASE_METADATA.json` 保留原始标签。该文件来自已有推理目录,尚未证明与本地 exp5 的 `checkpoint_003500` 逐 tensor 相同;不能仅凭 step 3500 标签把两者来源合并。本次发布核对了原文件完整 SHA256,未重新训练或转换这个文件。 | |
| ## 下载和完整性校验 | |
| 2026-11-19 用户授权后 HF 仓库已公开,可匿名下载;需要身份认证时仍可在本机登录或通过进程环境变量提供 `HF_TOKEN`。在已经安装 `huggingface_hub` 的 Python 环境中,从代码仓库根目录执行: | |
| ```bash | |
| python - <<'PY' | |
| from huggingface_hub import snapshot_download | |
| snapshot_download( | |
| repo_id="luyu1021/turbot2va-ltx2", | |
| repo_type="model", | |
| local_dir="./weights/turbot2va-ltx2", | |
| allow_patterns=[ | |
| "inference/published_turbot2av_main/*", | |
| "CHECKSUMS.json", "README.md", "LICENSE", | |
| ], | |
| ) | |
| PY | |
| sha256sum ./weights/turbot2va-ltx2/inference/published_turbot2av_main/model.pth | |
| ``` | |
| 输出应与上表 SHA256 完全一致。下载目录需要为权重和下载临时文件预留空间;若要固定复现实验,在 `snapshot_download` 中显式设置发布时记录的 HF commit SHA 为 `revision`,保留对应配置、代码 commit 和 seed。 | |
| ## 环境与最小推理命令 | |
| 按 [README](../README.md) 安装 PyTorch `2.7.0+cu128` 和四个本地 LTX 包。实际推理需要 CUDA、官方 dev 基座资产和 Gemma 编码器;当前参考文件只替换 student generator,加载代码仍从官方基座取得模型结构、AV VAE 等资产。 | |
| ```bash | |
| # 使用当前机器的真实路径;发布配置默认路径都是占位符。 | |
| export TURBO_CHECKPOINT_PATH=/path/to/ltx-2-19b-dev.safetensors | |
| export TURBO_GEMMA_PATH=/path/to/gemma-3-12b-it-qat-q4_0-unquantized | |
| # 先用仓库附带的一条 prompt 检查加载与音视频解码。 | |
| python -m ltx_distillation.tools.run_av_inference_eval \ | |
| --config_path configs/rcm_from_scm500.yaml \ | |
| --prompts_file examples/prompts.txt --num_prompts 1 \ | |
| --model_kind student \ | |
| --student_checkpoint ./weights/turbot2va-ltx2/inference/published_turbot2av_main/model.pth \ | |
| --student_param rcm_trig --student_strict \ | |
| --output_dir ./outputs/published_reference_probe \ | |
| --seed 12345 --num_seeds 1 | |
| ``` | |
| `--student_checkpoint` 指向 `.pth` 文件本身;仅包含这个文件的目录不符合 DCP 加载器要求。`--student_param rcm_trig` 使用该参考的阶段标签选择 TrigFlow 包装器;`--student_strict` 要求所有 generator 键匹配,出现 missing/unexpected keys 时应检查基座、代码和参考来源。这里只给出该标签对应的调用方法,本次没有执行 GPU 推理验证。 | |
| 推理配置使用 121 帧、512×768、24fps,时间序列为 `pi/2 -> 1.5 -> 1.4 -> 1.0 -> 0`,即 4 次 student 前向。评测入口和训练器独立,示例不会启动训练。多 prompt、多 seed 和质量/多样性协议见 [EVALUATION.md](EVALUATION.md)。 | |
| ## 训练恢复的边界 | |
| 这个 generator 文件可供推理,或供显式的模型层初始化;它没有完整训练状态。恢复原 RCM 训练需要对应 DCP 的全部 `sharded/`、`metadata.pth`、8-rank `optim/` 和 `rng/`,并使用匹配的 world size、数据与环境。发布清单中被标为完整恢复的 4 个 artifact 才包含这些文件,这 4 个 artifact 的完整恢复文件已上传并核验。 | |