surenreddy commited on
Commit
547190f
·
verified ·
1 Parent(s): d29d761

Update seamless_server/run_docker.sh

Browse files
Files changed (1) hide show
  1. seamless_server/run_docker.sh +29 -4
seamless_server/run_docker.sh CHANGED
@@ -1,5 +1,30 @@
1
- # !/bin/bash
2
- if [ -f models/Seamless/pretssel_melhifigan_wm.pt ] ; then
3
- export USE_EXPRESSIVE_MODEL=1;
 
 
 
4
  fi
5
- uvicorn app_pubsub:app --host 0.0.0.0 --port 7860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Enable expressive model if the weight exists
5
+ if [[ -f "models/Seamless/pretssel_melhifigan_wm.pt" ]]; then
6
+ export USE_EXPRESSIVE_MODEL=1
7
  fi
8
+
9
+ HOST="${HOST:-0.0.0.0}"
10
+ PORT="${PORT:-7860}"
11
+
12
+ # If you use websockets / in-memory pubsub, multiple workers can break things.
13
+ # Keep default 1, but allow override.
14
+ WORKERS="${UVICORN_WORKERS:-1}"
15
+
16
+ # If behind a reverse proxy, these help with client IP / scheme
17
+ PROXY_HEADERS="${UVICORN_PROXY_HEADERS:-true}"
18
+
19
+ ARGS=(app_pubsub:app --host "$HOST" --port "$PORT" --log-level "${UVICORN_LOG_LEVEL:-info}" --timeout-keep-alive "${UVICORN_KEEPALIVE:-75}")
20
+
21
+ if [[ "$PROXY_HEADERS" == "true" ]]; then
22
+ ARGS+=(--proxy-headers --forwarded-allow-ips "*")
23
+ fi
24
+
25
+ # Only set workers if explicitly >1 (safer default for websocket apps)
26
+ if [[ "$WORKERS" -gt 1 ]]; then
27
+ ARGS+=(--workers "$WORKERS")
28
+ fi
29
+
30
+ exec uvicorn "${ARGS[@]}"