
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
容器镜像运行构建
HuggingFace https://huggingface.co/docs/transformers/index库通过便捷的API支持各种NLP和视觉模型,被许多其他LLM包所使用。在https://huggingface.co/models上有大量与其兼容的模型。
[!NOTE]
如果您希望使用Transformer的集成https://huggingface.co/docs/transformers/main_classes/quantization#bitsandbytes-integration量化(`load_in_8bit/load_in_4bit`)或https://huggingface.co/docs/transformers/main_classes/quantization#autogptq-integration量化,请运行以下容器,这些容器在Transformers基础上包含了相应的库:
- https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/auto_gptq(依赖于Transformers)
- https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/bitsandbytes(依赖于Transformers)
替换您想要运行的https://huggingface.co/models?pipeline_tag=text-generation&sort=trending(应该是像GPT、Llama等CausalLM模型)
bash./run.sh $(./autotag transformers) \ huggingface-benchmark.py --model=gpt2
如果模型仓库是私有的或需要身份验证,请添加
--env HUGGINGFACE_TOKEN=<您的访问令牌>
默认情况下,性能测量会生成128个新的输出标记(可以使用--tokens=N设置)
可以使用--prompt='your prompt here'更改提示
精度/量化
使用--precision参数启用量化(选项:fp32 fp16 fp4 int8,默认:fp16)
如果您使用fp4或int8,请运行上面提到的https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/bitsandbytes容器,以便安装bitsandbytes包进行量化。预期通过Transformers的4位/8位量化比FP16慢(但消耗更少内存)- 更多信息请参见https://huggingface.co/docs/transformers/main_classes/quantization。
其他库如https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/exllama、https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/awq和https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/auto-gptq有自定义CUDA内核和更高效的量化性能。
Llama2
bash./run.sh --env HUGGINGFACE_TOKEN=<您的访问令牌> $(./autotag transformers) \ huggingface-benchmark.py --model=meta-llama/Llama-2-7b-hf
transformers | |
|---|---|
| 构建状态 | |
| 要求 | L4T ['>=32.6'] |
| 依赖项 | https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/build-essential https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cuda https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cudnn https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/python https://github.com/dusty-nv/jetson-containers/tree/master/packages/numpy https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/cmake/cmake_pip https://github.com/dusty-nv/jetson-containers/tree/master/packages/onnx https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch/torchvision https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/huggingface_hub https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/rust |
| 被依赖项 | https://github.com/dusty-nv/jetson-containers/tree/master/packages/audio/audiocraft https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/auto_awq https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/auto_gptq https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/awq https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/bitsandbytes https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/bitsandbytes https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/efficientvit https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/gptq-for-llama https://github.com/dusty-nv/jetson-containers/tree/master/packages/l4t/l4t-diffusion https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/llava https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/mlc https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/mlc https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/mlc https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/mlc https://github.com/dusty-nv/jetson-containers/tree/master/packages/vectordb/nanodb https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/nanoowl https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/nanosam https://github.com/dusty-nv/jetson-containers/tree/master/packages/nemo https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/optimum https://github.com/dusty-nv/jetson-containers/tree/master/packages/diffusion/stable-diffusion https://github.com/dusty-nv/jetson-containers/tree/master/packages/diffusion/stable-diffusion-webui https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/tensorrt_llm https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/tensorrt_llm https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/tensorrt_llm https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/tensorrt_llm https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/text-generation-inference https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/text-generation-webui https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/text-generation-webui https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/text-generation-webui https://github.com/dusty-nv/jetson-containers/tree/master/packages/audio/voicecraft https://github.com/dusty-nv/jetson-containers/tree/master/packages/audio/whisperx https://github.com/dusty-nv/jetson-containers/tree/master/packages/audio/xtts |
| Dockerfile | https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/transformers/Dockerfile |
| 镜像 | https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-12, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-11, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-05, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-14, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 1.5GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-11, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-12, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 7.6GB) |
| 说明 | 在JetPack5上添加了bitsandbytes和auto_gptq依赖项,用于4位/8位量化 |
transformers:git | |
|---|---|
| 构建状态 | |
| 要求 | L4T ['>=32.6'] |
| 依赖项 | https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/build-essential https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cuda https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cudnn https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/python https://github.com/dusty-nv/jetson-containers/tree/master/packages/numpy https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/cmake/cmake_pip https://github.com/dusty-nv/jetson-containers/tree/master/packages/onnx https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch/torchvision https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/huggingface_hub https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/rust |
| Dockerfile | https://github.com/dusty-nv/jetson-containers/tree/master/packages/llm/transformers/Dockerfile |
| 镜像 | https://hub.docker.com/r/dustynv/transformers/tags (2023-12-15, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-12, 5.9GB)https://hub.docker.com/r/dustynv/transformers/tags (2023-12-11, 5.9GB) |
| 说明 | 在JetPack5上添加了bitsandbytes和auto_gptq依赖项,用于4位/8位量化 |
transformers:nvgpt | |
|---|---|
| 构建状态 | |
| 要求 | L4T ['>=32.6'] |
| 依赖项 | [build-essential](https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/build- |
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务