diff --git a/Dockerfile b/Dockerfile index 0d86dec..c39655c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,6 +61,7 @@ ENV WHISPER_CLI=/app/whisper-cli ENV MODELS_DIR=/models ENV STT_PYTHON=python3 ENV HF_HOME=/hf-cache +ENV GLOSSARY_FILE=/glossary/glossary.json EXPOSE 8883 ENTRYPOINT ["./entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 60498ff..e8b4cba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,9 +33,11 @@ services: HF_HOME: /hf-cache HF_TOKEN: ${HF_TOKEN:-} PORT: "8883" + GLOSSARY_FILE: /glossary/glossary.json volumes: - "${MODELS_DIR:-/home/enne2/dev/whisper.cpp/models}:/models:ro" - "${HF_CACHE:-/home/enne2/.cache/huggingface}:/hf-cache:ro" + - "${GLOSSARY_FILE:-/home/enne2/dev/stt/glossary.json}:/glossary/glossary.json:ro" ports: - "${PORT:-8883}:8883" restart: unless-stopped diff --git a/glossary.example.json b/glossary.example.json new file mode 100644 index 0000000..0592928 --- /dev/null +++ b/glossary.example.json @@ -0,0 +1,39 @@ +{ + "people": [ + { + "canonical": "Giulia Bianchi", + "aliases": ["Giulia Bianci", "Julia Bianchi", "Giulia Bianche"], + "domain": "persone" + }, + { + "canonical": "Pietrolli", + "aliases": ["Pietro Lli", "Pietrolli"], + "domain": "persone" + } + ], + "organizations": [ + { + "canonical": "Perplexity AI", + "aliases": ["Perplexiti", "Perplexity"], + "domain": "aziende" + } + ], + "terms": [ + { + "canonical": "retrieval-augmented generation", + "aliases": ["rag", "retriaval augmented generation"], + "domain": "AI" + }, + { + "canonical": "fine-tuning", + "aliases": ["fine tuning", "fain tuning"], + "domain": "AI" + }, + { + "canonical": "stt-server", + "aliases": ["stt server", "esteti server", "siti server"], + "domain": "infrastruttura" + } + ], + "custom": [] +} diff --git a/server.py b/server.py index 92380e5..9fe499a 100644 --- a/server.py +++ b/server.py @@ -4,13 +4,18 @@ ASR: whisper.cpp (Vulkan) | Diarization opzionale: pyannote Community-1 (CPU) Endpoints: GET /health → {"status": "ok", "model": ...} - POST /transcribe → multipart: file=