Git Product home page Git Product logo

whisper-api's Introduction

Whisper API

Small API for Whisper transcription with a queue system using Celery. It is meant to be used with API calls, but a simple web interface is also available.

Project Structure

├── compose
│   └── docker-compose.yaml
|   └── docker-compose-prod.yaml
├── src
│   ├── api
│   │   ├── files
│   │   ├── models
│   │   ├── templates
|   |   |   └── index.html
|   |   |   └── transcribe.html
│   │   ├── tests
│   │   |   └── test.py
│   │   ├── worker
│   │   |   └── initialization.py
│   │   |   └── tasks.py
│   │   ├── app.py
│   │   └── utils.py
│   ├── Dockerfile
│   ├── guniconf.py
│   ├── poetry.lock
│   └── pyproject.toml
├── .pre-commit-config.yaml
└── README.md

Getting Started

Prerequisites

You must have Docker installed on your machine, and it is strongly recommended to have NVIDIA Container Runtime to have GPU support.

Setup

  1. Clone the repo

    git clone [email protected]:matthieuml/whisper-api.git
  2. Create an environment file .env in the compose/ directory

    SECRET_KEY=secret
    REDIS_HOST=redis
    REDIS_PASSWORD=password
    GUNICORN_NB_WORKERS=4
    WORKER_CONCURRENCY=2

    They are technically some default values, but you should change some of them for security reasons.

    The number of worker concurrency should be adjusted depending on the VRAM size of your GPU, and the memory requirement of your task. Otherwise, a task might fail due to a lack of memory.

  3. Build and run the Docker image

    docker compose -f compose/docker-compose-prod.yaml up

The API should be accessible at localhost:8000 or 0.0.0.0:8000.

Development

Environment

If you want to make some changes to the API, you can use the development environment with the command:

docker compose -f compose/docker-compose.yaml up

The app will be recompiled on every change, and the server will be restarted.

Tests

You can run the tests after starting the container with the command:

docker compose exec -T worker python -m pytest api/tests/test.py

Linting

This project uses pre-commit to lint the code. You can install it with the command:

pip install pre-commit

Then, you can install the hooks with the command:

pre-commit install

The hooks will be then run on every commit.

whisper-api's People

Contributors

matthieuml avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.