Adding usage example

master
Drew Bednar 2 years ago
parent 3bf33843f0
commit 0ce177b290

3
.gitignore vendored

@ -158,4 +158,5 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear # and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ .idea/
.vscode/

@ -1,3 +1,22 @@
# LocalWhisper # LocalWhisper
Making OpenAPI's Open Whisper available via ReST API locally. Making OpenAPI's Open Whisper available via ReST API locally.
## Features
- [x] Transcription
- [ ] Translation (Not-planned, but open to PRs)
## Usage Example
Similar to the OpenAI API we can post an audio file to `/audio/transcriptions` as a `multipart/form-data` type.
```
curl --request POST \
--url http://localhost:9000/audio/transcriptions \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--form 'file=@/path/to/file/example.wav;type=audio/wav'
--form 'model=whisper-1'
```
At present the `model` form field is not required or supported. The `WHISPER_BASE_ASR_MODEL` server configuration will be used to determine the Whisper model to use.

@ -26,6 +26,6 @@ def build(c):
@task @task
def serve_dev(c): def serve_dev(c, port=9000):
"""Runs the FastAPI webservice""" """Runs the FastAPI webservice"""
c.run("uvicorn local_whisper.webservice:app --reload") c.run(f"uvicorn local_whisper.webservice:app --reload --port {port}")

Loading…
Cancel
Save