Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whisper model server #73

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions whisper-playground/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN mkdir whisper && cd whisper && git clone https://github.com/ggerganov/whispe
git checkout tags/v1.5.4 && \
make && \
cp main /app/main && \
cp server /app/server && \
cp samples/jfk.wav /app/jfk.wav && \
cd ../ && rm -rf whisper

Expand Down
21 changes: 12 additions & 9 deletions whisper-playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,28 @@ ffmpeg -i <input.mp3> -ar 16000 -ac 1 -c:a pcm_s16le <output.wav>

The environment variable `AUDIO_FILE`, can be passed with your own audio file to override the default `/app/jfk.wav` file within the whisper image.

### Deploy Model
### Deploy Model Service

Deploy the LLM and volume mount the model of choice.
Here, we are mounting the `ggml-small.bin` model as downloaded from above.

To test with the default `/app/jfk.wav` audio file included in the image:

```bash
podman run --rm -it \
-p 8001:8001 \
-v /local/path/to/locallm/models/ggml-small.bin:/models/ggml-small.bin:Z,ro \
-e HOST=0.0.0.0 \
-e PORT=8001 \
whisper:image
```

To run with another audio file:
To test with the default `/app/jfk.wav` audio file included in the image:

```bash
podman run --rm -it \
-v /local/path/to/locallm/models/ggml-small.bin:/models/ggml-small.bin:Z,ro \
-v /local/path/to/<audio-file.wav>:/app/<audio-file.wav>:Z,ro \
-e AUDIO_FILE=/app/<audio-file.wav>
whisper:image
curl -v http://0.0.0.0:8001/inference -H "Content-Type: multipart/form-data" -F file=@/app/jfk.wav -F response-format="json"
```

To test with another audio file:

```bash
curl -v http://0.0.0.0:8001/inference -H "Content-Type: multipart/form-data" -F file=@<path-to-audio-file> -F response-format="json"
```
2 changes: 1 addition & 1 deletion whisper-playground/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! bin/bash

./main -m /models/ggml-small.bin -f ${AUDIO_FILE}
./server -tr -m /models/ggml-small.bin --host ${HOST:=0.0.0.0} --port ${PORT:=8001}