Chore: move docker/tts/stt inside of batteries dir
This commit is contained in:
38
Makefile
38
Makefile
@@ -12,45 +12,45 @@ setconfig:
|
|||||||
lint: ## Run linters. Use make install-linters first.
|
lint: ## Run linters. Use make install-linters first.
|
||||||
golangci-lint run -c .golangci.yml ./...
|
golangci-lint run -c .golangci.yml ./...
|
||||||
|
|
||||||
# Whisper STT Setup
|
# Whisper STT Setup (in batteries directory)
|
||||||
setup-whisper: build-whisper download-whisper-model
|
setup-whisper: build-whisper download-whisper-model
|
||||||
|
|
||||||
build-whisper: ## Build whisper.cpp from source
|
build-whisper: ## Build whisper.cpp from source in batteries directory
|
||||||
@echo "Building whisper.cpp from source..."
|
@echo "Building whisper.cpp from source in batteries directory..."
|
||||||
@if [ ! -d "whisper.cpp" ]; then \
|
@if [ ! -d "batteries/whisper.cpp" ]; then \
|
||||||
echo "Cloning whisper.cpp repository..."; \
|
echo "Cloning whisper.cpp repository to batteries directory..."; \
|
||||||
git clone https://github.com/ggml-org/whisper.cpp.git; \
|
git clone https://github.com/ggml-org/whisper.cpp.git batteries/whisper.cpp; \
|
||||||
fi
|
fi
|
||||||
cd whisper.cpp && make build
|
cd batteries/whisper.cpp && make build
|
||||||
@echo "Creating symlink to whisper-cli binary..."
|
@echo "Creating symlink to whisper-cli binary..."
|
||||||
@ln -sf whisper.cpp/build/bin/whisper-cli ./whisper-cli
|
@ln -sf batteries/whisper.cpp/build/bin/whisper-cli ./whisper-cli
|
||||||
@echo "Whisper binary built successfully!"
|
@echo "Whisper binary built successfully!"
|
||||||
|
|
||||||
download-whisper-model: ## Download Whisper model for STT
|
download-whisper-model: ## Download Whisper model for STT in batteries directory
|
||||||
@echo "Downloading Whisper model for STT..."
|
@echo "Downloading Whisper model for STT..."
|
||||||
@if [ ! -d "whisper.cpp" ]; then \
|
@if [ ! -d "batteries/whisper.cpp" ]; then \
|
||||||
echo "Please run 'make setup-whisper' first to clone the repository."; \
|
echo "Please run 'make setup-whisper' first to clone the repository."; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
@cd whisper.cpp && make tiny.en
|
@cd batteries/whisper.cpp && make tiny.en
|
||||||
@echo "Creating symlink to Whisper model..."
|
@echo "Creating symlink to Whisper model..."
|
||||||
@ln -sf whisper.cpp/models/ggml-tiny.en.bin ./ggml-model.bin
|
@ln -sf batteries/whisper.cpp/models/ggml-tiny.en.bin ./ggml-model.bin
|
||||||
@echo "Whisper model downloaded successfully!"
|
@echo "Whisper model downloaded successfully!"
|
||||||
|
|
||||||
# Docker targets for STT/TTS services
|
# Docker targets for STT/TTS services (in batteries directory)
|
||||||
docker-up: ## Start Docker Compose services for STT and TTS
|
docker-up: ## Start Docker Compose services for STT and TTS from batteries directory
|
||||||
@echo "Starting Docker services for STT (whisper) and TTS (kokoro)..."
|
@echo "Starting Docker services for STT (whisper) and TTS (kokoro)..."
|
||||||
docker-compose up -d
|
docker-compose -f batteries/docker-compose.yml up -d
|
||||||
@echo "Docker services started. STT available at http://localhost:8081, TTS available at http://localhost:8880"
|
@echo "Docker services started. STT available at http://localhost:8081, TTS available at http://localhost:8880"
|
||||||
|
|
||||||
docker-down: ## Stop Docker Compose services
|
docker-down: ## Stop Docker Compose services from batteries directory
|
||||||
@echo "Stopping Docker services..."
|
@echo "Stopping Docker services..."
|
||||||
docker-compose down
|
docker-compose -f batteries/docker-compose.yml down
|
||||||
@echo "Docker services stopped"
|
@echo "Docker services stopped"
|
||||||
|
|
||||||
docker-logs: ## View logs from Docker services
|
docker-logs: ## View logs from Docker services in batteries directory
|
||||||
@echo "Displaying logs from Docker services..."
|
@echo "Displaying logs from Docker services..."
|
||||||
docker-compose logs -f
|
docker-compose -f batteries/docker-compose.yml logs -f
|
||||||
|
|
||||||
# Convenience target to setup everything
|
# Convenience target to setup everything
|
||||||
setup-complete: setup-whisper docker-up
|
setup-complete: setup-whisper docker-up
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
# Whisper.cpp STT service
|
# Whisper.cpp STT service
|
||||||
whisper:
|
whisper:
|
||||||
image: ghcr.io/ggml-org/whisper.cpp:main
|
image: ghcr.io/ggml-org/whisper.cpp:main-cuda
|
||||||
container_name: whisper-stt
|
container_name: whisper-stt
|
||||||
ports:
|
ports:
|
||||||
- "8081:8081"
|
- "8081:8081"
|
||||||
@@ -10,7 +10,7 @@ services:
|
|||||||
- ./audio:/app/audio
|
- ./audio:/app/audio
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
entrypoint: ""
|
entrypoint: ""
|
||||||
command: ["./build/bin/whisper-server", "-m", "/app/models/ggml-tiny.en.bin", "-t", "4", "-p", "1", "--port", "8081", "--host", "0.0.0.0"]
|
command: ["./build/bin/whisper-server", "-m", "/app/models/ggml-large-v3-turbo-q5_0", "-t", "4", "-p", "1", "--port", "8081", "--host", "0.0.0.0"]
|
||||||
environment:
|
environment:
|
||||||
- WHISPER_LOG_LEVEL=3
|
- WHISPER_LOG_LEVEL=3
|
||||||
# Restart policy in case the service fails
|
# Restart policy in case the service fails
|
||||||
Reference in New Issue
Block a user