Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (42 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
services:
granite-speech-api:
build:
context: .
args:
# Default = CUDA 12.8 (torch ≥ 2.7). For ROCm or CPU, use the overlay files.
# Override: docker compose build --build-arg TORCH_INDEX=https://download.pytorch.org/whl/cu121
TORCH_INDEX: ${TORCH_INDEX:-https://download.pytorch.org/whl/cu128}
image: granite-speech-api:latest
container_name: granite-speech-api
restart: unless-stopped
ports:
- "${GRANITE_API_PORT:-8000}:8000"
environment:
GRANITE_API_HOST: 0.0.0.0
GRANITE_API_PORT: 8000
GRANITE_DEFAULT_MODEL: ${GRANITE_DEFAULT_MODEL:-ibm-granite/granite-speech-4.1-2b}
GRANITE_DEVICE: ${GRANITE_DEVICE:-auto}
GRANITE_DTYPE: ${GRANITE_DTYPE:-bfloat16}
GRANITE_MAX_AUDIO_SECONDS: ${GRANITE_MAX_AUDIO_SECONDS:-600}
GRANITE_IDLE_UNLOAD_SECONDS: ${GRANITE_IDLE_UNLOAD_SECONDS:-600}
GRANITE_IDLE_CHECK_INTERVAL: ${GRANITE_IDLE_CHECK_INTERVAL:-30}
GRANITE_CORS_ORIGINS: ${GRANITE_CORS_ORIGINS:-*}
GRANITE_REPETITION_PENALTY: ${GRANITE_REPETITION_PENALTY:-1.0}
GRANITE_NO_REPEAT_NGRAM_SIZE: ${GRANITE_NO_REPEAT_NGRAM_SIZE:-0}
HF_HOME: /data/hf-cache
HUGGING_FACE_HUB_TOKEN: ${HUGGING_FACE_HUB_TOKEN:-}
GRANITE_FEEDBACK_FILE: /data/feedback/feedback.jsonl
volumes:
- hf-cache:/data/hf-cache
- feedback:/data/feedback
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; urllib.request.urlopen('http://localhost:8000/health', timeout=5); sys.exit(0)"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
volumes:
hf-cache:
driver: local
feedback:
driver: local