docs: add readme

This commit is contained in:
Felix Spöttel
2023-02-08 15:42:31 +01:00
parent 0e0083976d
commit 27b6f8eb8f
5 changed files with 69 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
DATABASE_URI="sqlite:///memory"
ENVIRONMENT="test"
API_SECRET="test_secret"
BROKER_URL="memory://"
DATABASE_URI="sqlite:///memory"
ENVIRONMENT="test"

3
.gitignore vendored
View File

@@ -161,5 +161,6 @@ cython_debug/
# VS Code
.vscode
.DS_Store
whisperbox.sqlite

View File

@@ -1,3 +1,59 @@
# whisper-api
> Tiny HTTP wrapper around [openai/whisper](https://github.com/openai/whisper).
> HTTP wrapper around [openai/whisper](https://github.com/openai/whisper).
## API documentation
OpenAPI documentation can be accessed via `<service_url>/docs`.
## Deploy
// TODO
## Develop
It is recommended to setup a virtual environment for python tooling. To install dependencies dependencies in your virtual env, run `pip install -e .[tooling,web,worker]`
[docker-compose](https://docs.docker.com/get-started/08_using_compose/) is required for local development. Configuration such as `API_SECRET` can be adjusted in `./docker/dev/docker-compose.yml`.
### Start
```
make dev
```
Builds and starts the docker containers.
```
# Bindings
http://localhost:8000 => API
http://localhost:8000/docs => API docs
http://localhost:5555 => Celery dashboard
./whisperbox.sqlite => Database
```
## Destroy
This removes all containers and attached volumes.
```
make clean
```
### Test
```
make test
```
### Lint
```
make lint
```
### Format
```
make fmt
```

View File

@@ -1,5 +1,5 @@
from asyncio.log import logger
from typing import Dict, List, Optional
from typing import List, Optional
from uuid import UUID
from fastapi import APIRouter, Depends, FastAPI, HTTPException, Path
@@ -29,8 +29,8 @@ def queue_task(job: models.Job) -> None:
@api_router.get("/")
def api_root() -> Dict:
return {}
def api_root() -> None:
return None
class PostJobPayload(BaseModel):

View File

@@ -2,7 +2,7 @@ version: "3.8"
x-app-variables: &app-variables
API_SECRET: a_very_secret_token
DATABASE_URI: sqlite:////whisperbox.sqlite
DATABASE_URI: sqlite:///./whisperbox.sqlite
ENVIRONMENT: development
BROKER_URL: redis://redis:6379/0
WHISPER_MODEL: small
@@ -15,9 +15,10 @@ services:
- 6379:6379
networks:
- app
resources:
limits:
memory: 128M
deploy:
resources:
limits:
memory: 128M
web:
container_name: whisperbox_web_dev