ci: update CI configuration to run tests only for API and enhance README with Docker usage instructions

This commit is contained in:
remsky 2025-01-14 00:38:44 -07:00
parent 832955ca1d
commit 2649a0ba0c
4 changed files with 19 additions and 2 deletions

View file

@ -29,4 +29,4 @@ jobs:
- name: Run Tests - name: Run Tests
run: | run: |
uv run pytest api/tests/ ui/tests/ --asyncio-mode=auto --cov=api --cov=ui --cov-report=term-missing uv run pytest api/tests/ --asyncio-mode=auto --cov=api --cov-report=term-missing

View file

@ -25,13 +25,28 @@ The service can be accessed through either the API endpoints or the Gradio web i
1. Install prerequisites: 1. Install prerequisites:
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) + [Git](https://git-scm.com/downloads) - Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) + [Git](https://git-scm.com/downloads)
- Clone and start the service: - Clone the repository:
```bash ```bash
git clone https://github.com/remsky/Kokoro-FastAPI.git git clone https://github.com/remsky/Kokoro-FastAPI.git
cd Kokoro-FastAPI cd Kokoro-FastAPI
```
2. Start the service:
a. Using Docker Compose (recommended for full setup including UI):
```bash
docker compose up --build # for GPU docker compose up --build # for GPU
#docker compose -f docker-compose.cpu.yml up --build # for CPU #docker compose -f docker-compose.cpu.yml up --build # for CPU
``` ```
b. Running the API alone using Docker:
```bash
# For CPU version
docker run -p 8880:8880 kokoro-fastapi-cpu
# For GPU version (requires NVIDIA Container Toolkit)
docker run --gpus all -p 8880:8880 kokoro-fastapi-gpu
```
2. Run locally as an OpenAI-Compatible Speech Endpoint 2. Run locally as an OpenAI-Compatible Speech Endpoint
```python ```python
from openai import OpenAI from openai import OpenAI

View file

@ -1,3 +1,4 @@
name: kokoro-tts
services: services:
kokoro-tts: kokoro-tts:
# image: ghcr.io/remsky/kokoro-fastapi-cpu:latest # image: ghcr.io/remsky/kokoro-fastapi-cpu:latest

View file

@ -1,3 +1,4 @@
name: kokoro-tts
services: services:
kokoro-tts: kokoro-tts:
build: build: