Deploying AI4Bharat ASR using runpod. Refer https://github.com/adimyth/serverless-s2t-indicwav2vec
959
The models used in this project come from AI4Bharat's IndicWav2Vec project. These models are designed for Automatic Speech Recognition (ASR) for Indic languages.
To use these models with the Hugging Face transformers "automatic-speech-recognition" pipeline, additional steps were required to convert the ASR models into a HuggingFace-compatible format. An iPython notebook detailing this conversion process is available in this repository.
Before running the project, you need to build a Docker image that includes the necessary dependencies and the pre-downloaded model.
Ensure you have Docker installed on your system.
Set your HuggingFace API key as an environment variable:
export HF_API_KEY=your_huggingface_api_key
Build the Docker image:
docker build --build-arg HF_API_KEY=$HF_API_KEY -t ai4bharat-s2t-runpod .
This command builds the Docker image with the tag ai4bharat-s2t-runpod. The --build-arg flag passes your HuggingFace API key to the build process, allowing it to download the private model during the build.
This is needed because I had pushed the weights to my HF account.
Why build a custom Docker image?
pip install -r builder/requirements.txt
python3 src/handler.py --rp_serve_api --rp_api_host 0.0.0.0 --rp_log_level DEBUG
curl --location 'http://0.0.0.0:8000/runsync' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"audioURL": "https://www.tuttlepublishing.com/content/docs/9780804844383/06-18%20Part2%20Car%20Trouble.mp3", "language": "hi"}'
After building the image, you can run the container:
docker run -p 8000:8000 ai4bharat-s2t-runpod
This command runs the container and maps port 8000 from the container to port 8000 on your host machine.
Note
The weights were openly available. I just pushed the weights to my HF account and used the HF API as well as the pipeline to load & infer the model making it a whole lot easier
Content type
Image
Digest
sha256:386db936a…
Size
7.1 GB
Last updated
about 2 years ago
docker pull adimyth/serverless-stt-deployment:v1.5.0