预下载的 Diffusion LLM 模型,用于 CNB 云原生环境快速部署。
| 模型 | Hugging Face | 类型 |
|---|---|---|
| LLaDA-8B-Instruct | GSAI-ML/LLaDA-8B-Instruct | General |
| LLaDA-1.5 | GSAI-ML/LLaDA-1.5 | General |
| Dream-v0-Instruct-7B | Dream-org/Dream-v0-Instruct-7B | General |
| Dream-Coder-v0-Instruct-7B | Dream-org/Dream-Coder-v0-Instruct-7B | Code |
| DreamOn-v0-7B | Dream-org/DreamOn-v0-7B | Code |
| DiffuCoder-7B-cpGRPO | apple/DiffuCoder-7B-cpGRPO | Code |
dllm-modelsgit init
git add .
git commit -m "Initial commit"
git remote add origin https://cnb.cool/你的用户名/dllm-models.git
git push -u origin main
# 运行下载脚本
bash download_models.sh
下载大约需要 80-90GB 空间,请耐心等待。
下载完成后,在同一个环境中执行:
# 构建包含模型的镜像
docker build -t cnb.cool/你的用户名/dllm-models:v1 .
# 推送到 CNB 制品库
docker push cnb.cool/你的用户名/dllm-models:v1
在你的 GPU 项目中:
# 拉取模型镜像
docker pull cnb.cool/你的用户名/dllm-models:v1
# 复制模型到本地
docker run --rm -v $(pwd)/models:/dest cnb.cool/你的用户名/dllm-models:v1 \
cp -r /models/. /dest/
或者在代码中直接挂载:
from transformers import AutoModel, AutoTokenizer
import torch
model_path = "/path/to/models/LLaDA-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16)
如果只需要下载特定模型:
# 设置模型目录
export MODEL_DIR=/workspace/models
# 下载单个模型
huggingface-cli download GSAI-ML/LLaDA-8B-Instruct \
--local-dir $MODEL_DIR/LLaDA-8B-Instruct \
--local-dir-use-symlinks False
download_models.sh - 批量下载模型的脚本Dockerfile - 包含模型的最终镜像Dockerfile.downloader - 下载器镜像.cnb.yml - CNB 构建配置