perf(hermes): use conversational Whisper default

This commit is contained in:
jenkins 2026-08-10 01:30:50 -03:00
parent fb2a30d459
commit 4f986b6ccb
6 changed files with 13 additions and 9 deletions

View File

@ -14,6 +14,9 @@ RUN python3 -m pip install --no-cache-dir --force-reinstall --no-deps \
ADD --checksum=sha256:aff26ae408abcba5fbf8813c21e62b0941638c5f6eebfb145be0c9839262a19a --chmod=0444 \ ADD --checksum=sha256:aff26ae408abcba5fbf8813c21e62b0941638c5f6eebfb145be0c9839262a19a --chmod=0444 \
https://openaipublic.azureedge.net/main/whisper/models/aff26ae408abcba5fbf8813c21e62b0941638c5f6eebfb145be0c9839262a19a/large-v3-turbo.pt \ https://openaipublic.azureedge.net/main/whisper/models/aff26ae408abcba5fbf8813c21e62b0941638c5f6eebfb145be0c9839262a19a/large-v3-turbo.pt \
/opt/models/whisper/large-v3-turbo.pt /opt/models/whisper/large-v3-turbo.pt
ADD --checksum=sha256:9ecf779972d90ba49c06d968637d720dd632c55bbf19d441fb42bf17a411e794 --chmod=0444 \
https://openaipublic.azureedge.net/main/whisper/models/9ecf779972d90ba49c06d968637d720dd632c55bbf19d441fb42bf17a411e794/small.pt \
/opt/models/whisper/small.pt
RUN chmod 0555 /opt/models /opt/models/whisper RUN chmod 0555 /opt/models /opt/models/whisper
COPY dockerfiles/hermes-jetson-stt-server.py /opt/atlas/hermes-jetson-stt-server.py COPY dockerfiles/hermes-jetson-stt-server.py /opt/atlas/hermes-jetson-stt-server.py
@ -25,11 +28,11 @@ WORKDIR /opt/atlas
# Import the Xavier CUDA stack and confirm Whisper resolves the baked artifact. # Import the Xavier CUDA stack and confirm Whisper resolves the baked artifact.
# Full GPU warm-up is covered by the Kubernetes startup probe on titan-21. # Full GPU warm-up is covered by the Kubernetes startup probe on titan-21.
RUN python3 -c "import stat; from pathlib import Path; import torch, whisper; p=Path('/opt/models/whisper'); print(whisper.__file__, whisper.__version__, whisper.available_models()); assert 'large-v3-turbo' in whisper.available_models(); assert stat.S_IMODE(p.stat().st_mode)==0o555; assert stat.S_IMODE((p/'large-v3-turbo.pt').stat().st_mode)==0o444; print(torch.__version__)" RUN python3 -c "import stat; from pathlib import Path; import torch, whisper; p=Path('/opt/models/whisper'); print(whisper.__file__, whisper.__version__, whisper.available_models()); assert {'large-v3-turbo','small'} <= set(whisper.available_models()); assert stat.S_IMODE(p.stat().st_mode)==0o555; assert all(stat.S_IMODE((p/name).stat().st_mode)==0o444 for name in ('large-v3-turbo.pt','small.pt')); print(torch.__version__)"
ENV HERMES_STT_HOST=0.0.0.0 \ ENV HERMES_STT_HOST=0.0.0.0 \
HERMES_STT_PORT=9000 \ HERMES_STT_PORT=9000 \
HERMES_STT_MODEL=large-v3-turbo \ HERMES_STT_MODEL=small \
HERMES_STT_CACHE=/opt/models/whisper \ HERMES_STT_CACHE=/opt/models/whisper \
PYTHONDONTWRITEBYTECODE=1 \ PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 PYTHONUNBUFFERED=1

View File

@ -17,7 +17,7 @@ import whisper
HOST = os.getenv("HERMES_STT_HOST", "0.0.0.0") HOST = os.getenv("HERMES_STT_HOST", "0.0.0.0")
PORT = int(os.getenv("HERMES_STT_PORT", "9000")) PORT = int(os.getenv("HERMES_STT_PORT", "9000"))
MODEL_NAME = os.getenv("HERMES_STT_MODEL", "large-v3-turbo") MODEL_NAME = os.getenv("HERMES_STT_MODEL", "small")
CACHE_DIR = Path(os.getenv("HERMES_STT_CACHE", "/cache/whisper")) CACHE_DIR = Path(os.getenv("HERMES_STT_CACHE", "/cache/whisper"))
MAX_AUDIO_BYTES = 30 * 1024 * 1024 MAX_AUDIO_BYTES = 30 * 1024 * 1024
MODEL_LOCK = threading.Lock() MODEL_LOCK = threading.Lock()

View File

@ -39,7 +39,7 @@ data:
enabled: true enabled: true
provider: local_command provider: local_command
local: local:
model: large-v3-turbo model: small
language: auto language: auto
model_catalog: model_catalog:
enabled: true enabled: true

View File

@ -48,7 +48,7 @@ def main() -> None:
parser.add_argument("input_path", type=Path) parser.add_argument("input_path", type=Path)
parser.add_argument("--output-dir", required=True, type=Path) parser.add_argument("--output-dir", required=True, type=Path)
parser.add_argument("--language", default="auto") parser.add_argument("--language", default="auto")
parser.add_argument("--model", default="large-v3-turbo") parser.add_argument("--model", default="small")
args = parser.parse_args() args = parser.parse_args()
body, boundary = _multipart(args.input_path, args.language, args.model) body, boundary = _multipart(args.input_path, args.language, args.model)

View File

@ -19,7 +19,7 @@ spec:
app: hermes-stt app: hermes-stt
annotations: annotations:
ai.bstein.dev/role: private-chat-speech-to-text ai.bstein.dev/role: private-chat-speech-to-text
ai.bstein.dev/model: whisper-turbo ai.bstein.dev/model: whisper-small-multilingual
ai.bstein.dev/gpu: titan-21 dedicated speech time-slice ai.bstein.dev/gpu: titan-21 dedicated speech time-slice
spec: spec:
runtimeClassName: nvidia runtimeClassName: nvidia
@ -31,7 +31,7 @@ spec:
kubernetes.io/hostname: titan-21 kubernetes.io/hostname: titan-21
containers: containers:
- name: stt - name: stt
image: registry.bstein.dev/bstein/hermes-jetson-stt@sha256:d70bc0892bfce7dc474b24c62d2427a22c6022d0d406c349fcb83d82130de768 image: registry.bstein.dev/bstein/hermes-jetson-stt@sha256:341fd5c93d202d7368bbd74bd392f207c66e6d3968cc39f2d1684ec87a9d3899
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- {name: http, containerPort: 9000, protocol: TCP} - {name: http, containerPort: 9000, protocol: TCP}
@ -39,7 +39,7 @@ spec:
- {name: HOME, value: /tmp} - {name: HOME, value: /tmp}
- {name: XDG_CACHE_HOME, value: /tmp/cache} - {name: XDG_CACHE_HOME, value: /tmp/cache}
- {name: HERMES_STT_PORT, value: "9000"} - {name: HERMES_STT_PORT, value: "9000"}
- {name: HERMES_STT_MODEL, value: large-v3-turbo} - {name: HERMES_STT_MODEL, value: small}
- {name: HERMES_STT_CACHE, value: /opt/models/whisper} - {name: HERMES_STT_CACHE, value: /opt/models/whisper}
- {name: NVIDIA_VISIBLE_DEVICES, value: all} - {name: NVIDIA_VISIBLE_DEVICES, value: all}
- {name: NVIDIA_DRIVER_CAPABILITIES, value: compute,utility} - {name: NVIDIA_DRIVER_CAPABILITIES, value: compute,utility}

View File

@ -171,7 +171,7 @@ def test_chat_voice_uses_private_jetson_services_and_shared_auto_route():
assert config["stt"] == { assert config["stt"] == {
"enabled": True, "enabled": True,
"provider": "local_command", "provider": "local_command",
"local": {"model": "large-v3-turbo", "language": "auto"}, "local": {"model": "small", "language": "auto"},
} }
dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-webui").read_text() dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-webui").read_text()
@ -191,6 +191,7 @@ def test_voice_models_are_baked_and_runtime_has_no_public_egress():
stt_dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-jetson-stt").read_text() stt_dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-jetson-stt").read_text()
tts_dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-jetson-tts").read_text() tts_dockerfile = (ROOT / "dockerfiles" / "Dockerfile.hermes-jetson-tts").read_text()
assert "ADD --checksum=sha256:aff26ae4" in stt_dockerfile assert "ADD --checksum=sha256:aff26ae4" in stt_dockerfile
assert "ADD --checksum=sha256:9ecf7799" in stt_dockerfile
assert "--chmod=0444" in stt_dockerfile assert "--chmod=0444" in stt_dockerfile
assert "chmod 0555 /opt/models /opt/models/whisper" in stt_dockerfile assert "chmod 0555 /opt/models /opt/models/whisper" in stt_dockerfile
assert "HERMES_STT_CACHE=/opt/models/whisper" in stt_dockerfile assert "HERMES_STT_CACHE=/opt/models/whisper" in stt_dockerfile