If you find this useful, remember about giving a start ⭐ to this repo or share it 🔁
Forked from Lablab-ai/whisper-api-flask
With this repo, you will deploy, using Docker Compose, an API of Whisper, an automatic State-of-the-Art speech recognition system from OpenAI that has been trained on 680,000 hours of multilingual and multitask supervised data collected from the web, running on a Flask server.
It is composed by a single container:
whisper-api
, Whisper API running on a Flash server.
-
You need Docker and Docker-compose where you are going to launch this so, if you do not have it... click HERE or go to the end of this
.md
^^ -
Clone this rep.
-
Check the app.py in order to understand the logic, change the model of any other configuration.
-
Run
docker-compose up -d
ordocker-compose up
if you want to check the logs directly. -
Check that the container is correctly deployed and running.
-
If everything lookd good. Lets have some fun with it:
- Test the API by sending a POST request to the route http://localhost:5000/whisper, or the endpoint you have defined inside the
app.py
file, with a file in it. Body should be form-data. - For terminal lovers, you can test it with this curl command:
curl -F "file=@/path/to/file" http://localhost:5000/whisper
- The result should out put a JSON object with the transcription in it 🍻
- Test the API by sending a POST request to the route http://localhost:5000/whisper, or the endpoint you have defined inside the
-
Run Docker Compose:
docker compose up -d
/docker compose up
-
Check Docker Compose's volumens status:
docker compose ps -a
/docker compose ps
-
Check Docker's images:
docker images -a
-
Remove Docker's images:
docker rmi -f imageID1 imageID2 ...
(-f = force) -
Enter to a Docker's volumen:
docker compose exec VolumenID sh
/docker compose exec VolumenID bash
-
Copy a file to the docker we want to:
docker cp file docker_id:/dir
-
Remove all dangling (not tagged or associated with a container) containers, volumes, networks and images:
docker system prune
-
Remove all unused containers and images with at least one container associated to them:
docker system prune -a
-
Shows all unused local images:
docker images ls -f dangling=true
-
Shows all unused local volumes:
docker volume ls -f dangling=true
-
Remove all local volumes not used by at least one container:
docker volume prune
-
Download and install Docker:
apt install docker
-
Gives permisions so you can run it everywhere:
sudo usermod -aG docker $USER
-
Starts Docker's service:
service docker start
-
Starts Docker's service each time you run the SO:
chkconfig docker on
For this repo, DockerComposeV2 was used, so that is why we use docker compose
instead of docker-compose
. If you are using DockerComposeV1, have this in mind.
-
Run
sudo apt-get install docker-compose-plugin
-
Check which versions are availables with
apt-cache madison docker-compose-plugin
-
Intall the version you are looking for with
sudo apt-get install docker-compose-plugin=<VERSION_STRING>
, for this reposudo apt install docker-compose-plugin=2.6.0~ubuntu-focal
was used. -
Check the version and the installation:
docker compose version
If you find any bug or just want to give your feedback (remember the ⭐ ^^), Feel free to do it. I am, like you, constantly learning and things change so quickly that... no one knows ^^
- v1.0 - Current - Creation of the rep with the config finished - 29/04/2023