HUB
Sign inSign up
asr-api logo

saladtechnologies/asr-api

By saladtechnologies

•Updated almost 3 years ago

A minimalist, performance-oriented inference server for automatic speech recognition.

Image
1

9.1K

saladtechnologies/asr-api repository overview

⁠asr-api

A minimalist, performance-oriented inference server for automatic speech recognition. More extensive benchmarks will come soon, but for now, here's some prelimary numbers from my 3080 Ti:

ModelInput Audio LengthRealtime Multiple
OpenAI Whisper Large v3⁠19 min 51s50x
Distil Whisper Distil Large v2⁠19 min 51s78x

⁠API

⁠GET /hc

This healthcheck will not respond until the server is fully ready to accept requests.

⁠Response
{
  "status": "ok",
  "version": "0.0.2",
}
⁠POST /asr
⁠Request

URL should be a download link to an audio file. Currently only supports mp3, flac, and wav.

{
  "url": "https://example.com/audio.mp3",
}
⁠Response
{
  "text": "hello world",
  "chunks": [
    {
      "timestamp": [
        0.0,
        2.1
      ],
      "text": "hello world"
    },
  ]
}

⁠Configuration

All configuration is via environment variables.

See documentation for the ASR Pipeline⁠ for more information on the model configuration options:

NameDescriptionDefault
HOSTThe host to listen on*
PORTThe port to listen on8000
MODEL_IDThe model to use. See Automatic Speech Recognition Models⁠openai/whisper-large-v3
CACHE_DIRThe directory to cache models in/data
FLASH_ATTENTION_2Whether to use flash attention 2. Must be 1 to enable. Enabled by default in -fa2 images. Note, if your GPU does not support compute capability >= 8.9, BetterTransformers will be used instead.None
BATCH_SIZEThe batch size to use.16
MAX_NEW_TOKENSNot sure what this does.128
CHUNK_LENGTH_SThe length of each chunk in seconds.30
STRIDE_LENGTH_SThe stride length in seconds. Defaults to 1/6 of CHUNK_LENGTH_SCHUNK_LENGTH_S / 6

⁠Docker Images

  • saladtechnologies/asr-api:latest, saladtechnologies/asr-api:0.0.2 - The base image, no models included. Does not support flash attention 2, but is a smaller base image. Will download the model at runtime.
  • saladtechnologies/asr-api:latest-fa2 ,saladtechnologies/asr-api:0.0.2-fa2 - The base image, no models included. Supports flash attention 2, but is a larger base image. Will download the model at runtime.
  • saladtechnologies/asr-api:latest-openai-whisper-large-v3, saladtechnologies/asr-api:0.0.2-openai-whisper-large-v3 - The base image, with the OpenAI Whisper Large v3⁠ model included. Does not support flash attention 2.
  • saladtechnologies/asr-api:latest-fa2-openai-whisper-large-v3, saladtechnologies/asr-api:0.0.2-fa2-openai-whisper-large-v3 - The base image, with the OpenAI Whisper Large v3⁠ model included. Supports flash attention 2.
  • saladtechnologies/asr-api:latest-distil-whisper-distil-large-v2, saladtechnologies/asr-api:0.0.2-distil-whisper-distil-large-v2 - The base image, with the Distil Whisper Distil Large v2⁠ model included. Does not support flash attention 2.
  • saladtechnologies/asr-api:latest-fa2-distil-whisper-distil-large-v2, saladtechnologies/asr-api:0.0.2-fa2-distil-whisper-distil-large-v2 - The base image, with the Distil Whisper Distil Large v2⁠ model included. Supports flash attention 2.

Tag summary

Content type

Image

Digest

sha256:142f09675…

Size

3.7 GB

Last updated

almost 3 years ago

docker pull saladtechnologies/asr-api