本地部署详细指南
安装运行需要以下步骤:
- environmental preparation::
安装 Python 3.8+ 并执行命令:pip install transformers torch
GPU 用户需额外安装 CUDA 版 PyTorch - Model Download::
通过 Hugging Face 库加载:from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "tngtech/DeepSeek-TNG-R1T2-Chimera"
model = AutoModelForCausalLM.from_pretrained(model_name) - Hardware configuration::
建议至少 32GB RAM,GPU 需 16GB+ 显存
多 GPU 可使用device_map="auto"
parameters - 基础推理::
Sample code:input_text = "解释区块链技术"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=200)
注意:模型文件约 13.5GB,需确保网络稳定和足够存储空间。
This answer comes from the articleDeepSeek-TNG-R1T2-Chimera: Enhanced version of DeepSeek released by TNG, GermanyThe