Funktionierender STand!!!

This commit is contained in:
2026-06-20 19:54:41 +02:00
parent 404c632cfc
commit cc3c0dad7b
6 changed files with 379 additions and 89 deletions

View File

@@ -7,9 +7,9 @@
set -e
MODEL="${QWEN3_TTS_MODEL:-Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice}"
PORT=8091
PORT=8091 # external-facing proxy port (clients connect here)
VLLM_PORT=8095 # internal vllm-omni port
UI_PORT=8092
WS_LOG_PORT=8094
# --- Runtime-Patches fuer Qwen3-TTS anwenden ---
if [ -f /patch_qwen3_tts_runtime.py ]; then
@@ -21,28 +21,29 @@ if [ -f /voice_clone_ui.py ]; then
python3 /voice_clone_ui.py \
--host 0.0.0.0 \
--port "$UI_PORT" \
--api-base "http://localhost:${PORT}" \
--api-base "http://localhost:${VLLM_PORT}" \
--clone-api-base "http://qwen3-tts-clone:8093" \
--model "$MODEL" &
UI_PID=$!
echo "[ui] Voice-Cloning-UI laeuft auf Port ${UI_PORT}"
fi
# --- WebSocket-Logging-Proxy im Container starten ---
# --- WebSocket-Proxy auf dem client-facing PORT starten ---
# Proxy sitzt vor vllm-omni und fuegt Stille-Fuellen zwischen Saetzen ein.
if [ -f /ws_log_proxy.py ]; then
python3 /ws_log_proxy.py \
--host 0.0.0.0 \
--port "$WS_LOG_PORT" \
--upstream "ws://localhost:${PORT}/v1/audio/speech/stream" &
WS_LOG_PID=$!
echo "[ws-log] Proxy laeuft auf Port ${WS_LOG_PORT}"
--port "$PORT" \
--upstream "ws://localhost:${VLLM_PORT}/v1/audio/speech/stream" &
WS_PROXY_PID=$!
echo "[ws-proxy] Proxy laeuft auf Port ${PORT} -> vllm-omni Port ${VLLM_PORT}"
fi
# --- Server im Hintergrund starten ---
# --- vllm-omni Server intern auf VLLM_PORT starten ---
vllm-omni serve "$MODEL" \
--omni \
--host 0.0.0.0 \
--port "$PORT" \
--port "$VLLM_PORT" \
--deploy-config /deploy/qwen3_tts.yaml \
--gpu-memory-utilization 0.10 \
--trust-remote-code &
@@ -51,10 +52,10 @@ SERVER_PID=$!
# --- Warmup im Hintergrund, sobald der Server gesund ist ---
(
for _ in $(seq 1 150); do
if curl -sf "http://localhost:${PORT}/health" >/dev/null 2>&1; then
if curl -sf "http://localhost:${VLLM_PORT}/health" >/dev/null 2>&1; then
echo "[warmup] Server gesund — sende Warmup-Request (kompiliert CUDA-Graphen)..."
t0=$SECONDS
curl -sf -X POST "http://localhost:${PORT}/v1/audio/speech" \
curl -sf -X POST "http://localhost:${VLLM_PORT}/v1/audio/speech" \
-H 'Content-Type: application/json' \
-d "{\"model\":\"${MODEL}\",\"input\":\"System wird aufgewärmt.\",\"voice\":\"Ryan\",\"language\":\"German\",\"response_format\":\"wav\"}" \
-o /dev/null \
@@ -67,5 +68,5 @@ SERVER_PID=$!
) &
# --- Auf den Server-Prozess warten (PID 1 Signalweiterleitung) ---
trap 'kill "$SERVER_PID" "${UI_PID:-}" "${WS_LOG_PID:-}" 2>/dev/null || true' TERM INT
trap 'kill "$SERVER_PID" "${UI_PID:-}" "${WS_PROXY_PID:-}" 2>/dev/null || true' TERM INT
wait "$SERVER_PID"