Text Generation
Transformers
Safetensors
English
Chinese
deepseek_v4
nvfp4
ocp-mx
quantization
amd-quark
Mixture of Experts
deepseek
8-bit precision
quark
Instructions to use amd/DeepSeek-V4-Pro-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amd/DeepSeek-V4-Pro-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amd/DeepSeek-V4-Pro-NVFP4")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("amd/DeepSeek-V4-Pro-NVFP4") model = AutoModelForCausalLM.from_pretrained("amd/DeepSeek-V4-Pro-NVFP4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amd/DeepSeek-V4-Pro-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amd/DeepSeek-V4-Pro-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amd/DeepSeek-V4-Pro-NVFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/amd/DeepSeek-V4-Pro-NVFP4
- SGLang
How to use amd/DeepSeek-V4-Pro-NVFP4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "amd/DeepSeek-V4-Pro-NVFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amd/DeepSeek-V4-Pro-NVFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "amd/DeepSeek-V4-Pro-NVFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amd/DeepSeek-V4-Pro-NVFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use amd/DeepSeek-V4-Pro-NVFP4 with Docker Model Runner:
docker model run hf.co/amd/DeepSeek-V4-Pro-NVFP4
Update README.md
Browse files
README.md
CHANGED
|
@@ -50,7 +50,7 @@ The end-to-end recipe lives in the Quark examples:
|
|
| 50 |
`run_pipeline.sh`. The quantization scope is controlled by `EXCLUDE_LAYERS`.
|
| 51 |
|
| 52 |
```bash
|
| 53 |
-
export EXCLUDE_LAYERS="*
|
| 54 |
export SRC=deepseek-ai/DeepSeek-V4-Pro
|
| 55 |
export OUT=amd/DeepSeek-V4-Pro-NVFP4
|
| 56 |
|
|
@@ -104,7 +104,7 @@ The model was evaluated on GSM8K benchmarks.
|
|
| 104 |
|
| 105 |
### Reproduction
|
| 106 |
|
| 107 |
-
The GSM8K result was obtained using the `lm-evaluation-harness` framework, based on the Docker image `
|
| 108 |
|
| 109 |
Install the lm-eval `(Version: 0.4.12)` in container first.
|
| 110 |
```
|
|
|
|
| 50 |
`run_pipeline.sh`. The quantization scope is controlled by `EXCLUDE_LAYERS`.
|
| 51 |
|
| 52 |
```bash
|
| 53 |
+
export EXCLUDE_LAYERS="*ffn.gate *ffn_norm embed head norm mtp*" \
|
| 54 |
export SRC=deepseek-ai/DeepSeek-V4-Pro
|
| 55 |
export OUT=amd/DeepSeek-V4-Pro-NVFP4
|
| 56 |
|
|
|
|
| 104 |
|
| 105 |
### Reproduction
|
| 106 |
|
| 107 |
+
The GSM8K result was obtained using the `lm-evaluation-harness` framework, based on the Docker image `vllm/vllm-openai-rocm:v0.29.0`.
|
| 108 |
|
| 109 |
Install the lm-eval `(Version: 0.4.12)` in container first.
|
| 110 |
```
|