什么是 DeepSeek?
DeepSeek 是由深度求索(DeepSeek)推出的一系列开源大语言模型,支持多种应用场景,如代码生成、问答、文本创作等。其开源版本可在本地或服务器上部署。
安装前准备
- 操作系统:Linux / Windows (WSL) / macOS
- Python 版本 ≥ 3.9
- 显卡(推荐 NVIDIA GPU,显存 ≥ 8GB)
- 安装 Git、CUDA(如使用 GPU)
安装步骤
- 克隆官方仓库:
git clone https://github.com/deepseek-ai/DeepSeek.git - 进入项目目录并安装依赖:
cd DeepSeek pip install -r requirements.txt - 下载模型权重(需 Hugging Face 账号):
huggingface-cli login git lfs install git clone https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base - 运行推理脚本:
python inference.py --model_path ./deepseek-coder-1.3b-base
常见问题
Q:没有 GPU 能运行吗?
A:可以,但速度较慢,建议使用 CPU 模式或量化版本。
Q:模型文件太大怎么办?
A:可选择 smaller 版本(如 1.3B),或使用 GGUF 格式配合 llama.cpp 运行。