Download tools/server_run.sh from RightNowAI/duplex-v0: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/server_run.sh
- Command line
-
hf download hf://RightNowAI/duplex-v0/tools/server_run.sh
-
curl -L -o server_run.sh https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/server_run.sh
1.43 kB
| # The WebSocket endpoint on GPU 0 (next to the baseline). Pass "controller" to load the trained controller (on GPU 1). | |
| # Pass "think" for think-then-speak. PORT=<n> sets the port (default 8765). | |
| # FIRST_CHUNK=<n> sets the size of a reply's first audio chunk (default 25, the released recipe). | |
| cd /data/train/duplex && . /data/train/venv/bin/activate | |
| # GPU=<n> puts the audio decoder beside the baseline copy on that GPU; VLLM_PORT is that copy's port. | |
| # DECODER_GPU=<n> moves the decoder to another GPU. FP16=1 runs it in half precision. | |
| export HF_HOME=/data/train/hf OMP_NUM_THREADS=8 CUDA_VISIBLE_DEVICES=${DECODER_GPU:-${GPU:-0}},$(( (${GPU:-0} + 1) % 8 )) | |
| EXTRA="" | |
| [ "${1:-}" = "think" ] && EXTRA="--think-first --think-max-tokens ${THINK_TOKENS:-2048}" | |
| [ "${1:-}" = "controller" ] && EXTRA="--encoder-ckpt runs/encoder/final.pt --controller-ckpt runs/controller/final.pt --controller-device cuda:1" | |
| exec python -u -m serving.server --reply-prefix '<tts_start>' --vllm-url "http://127.0.0.1:${VLLM_PORT:-9999}/v1/chat/completions" ${SERVER_ARGS:-} \ | |
| --step-audio2-dir /data/train/src/Step-Audio2 --token2wav-dir /data/train/models/Step-Audio-2-mini/token2wav \ | |
| --prompt-wav "${PROMPT:-runs/prompt_af_heart.wav}" --first-chunk "${FIRST_CHUNK:-25}" --min-chunk "${MIN_CHUNK:-25}" --low-water-ms "${LOW_WATER:-0}" --decoder-workers "${WORKERS:-1}" ${FP16:+--decoder-fp16} --port "${PORT:-8765}" $EXTRA | |