This repo runs DeepSeek-R1-Distill-Qwen-7B with SGLang and evaluates GSM8K.
cd /home/zhj/Paper
uv syncFLASHINFER_WORKSPACE_DIR=/tmp/flashinfer \
UV_CACHE_DIR=/tmp/uv-cache \
uv run python -m sglang.launch_server \
--model-path /home/zhj/models/DeepSeek-R1-Distill-Qwen-7B \
--trust-remote-code \
--dtype bfloat16 \
--host 0.0.0.0 \
--port 30000 \
--context-length 8192 \
--mem-fraction-static 0.85 \
--tensor-parallel-size 1For multi-GPU, set --tensor-parallel-size to the GPU count (for example 4).
If you explicitly enable --reasoning-parser deepseek-r1, outputs may appear in reasoning_content.
UV_CACHE_DIR=/tmp/uv-cache \
uv run python infer_local.py \
--base-url http://127.0.0.1:30000/v1 \
--model /home/zhj/models/DeepSeek-R1-Distill-Qwen-7B \
--prompt "用中文解释注意力机制为什么有效"UV_CACHE_DIR=/tmp/uv-cache \
uv run python eval_gsm8k.py \
--base-url http://127.0.0.1:30000/v1 \
--model /home/zhj/models/DeepSeek-R1-Distill-Qwen-7B \
--dataset-dir /home/zhj/Paper/gsm8k_main \
--split test \
--prompt-style final_only \
--batch-size 16 \
--concurrency 4 \
--max-new-tokens 256 \
--save-jsonl /home/zhj/Paper/results/gsm8k_sglang_qwen7b.jsonlThe script prints final accuracy and saves per-sample outputs to results/.