Sign inSign up

adimyth/serverless-s2t-indic-conformer

By adimyth

•Updated almost 2 years ago

Deploying AI4Bharat Indic Conformer ASR model as a serverless endpoint on runpod

Image
Machine learning & AI
0

1.4K

adimyth/serverless-s2t-indic-conformer repository overview

⁠Deploying AI4Bharat Indic Conformer S2T Models on RunPod

⁠Model Information

The models used in this project come from AI4Bharat's Indic Conformer⁠ project.

⁠Building the Docker Image

Before running the project, you need to build a Docker image that includes the necessary dependencies and the pre-downloaded model.

  1. Ensure you have Docker installed on your system.

  2. Build the Docker image:

docker image build -f Dockerfile -t adimyth/serverless-s2t-indic-conformer:v1.0.0 .

This command builds the Docker image with the tag adimyth/serverless-s2t-indic-conformer:v1.0.0

⁠Running the project locally
  1. Clone the repository
  2. Install the requirements
python3 -m venv .venv
source .venv/bin/activate

pip install -r builder/requirements.txt
  1. Install nemo
git clone https://github.com/AI4Bharat/NeMo.git -b nemo-v2
pip install packaging huggingface_hub==0.23.2
cd NeMo && bash reinstall.sh
cd ..
  1. Make directory for storing the model
sudo mkdir -p /temp/models/asr

sudo chmod -R 777 /temp/models/asr

wget https://objectstore.e2enetworks.net/indic-asr-public/indicConformer/ai4b_indicConformer_hi.nemo -O /temp/models/asr/hi.nemo

Modify the src/handler.py file to remove the other languages from the list & update the model prefix path to /temp/models/asr/ instead

  1. Run the project. This will start the FastAPI server on the specified host at port 8000.
python3 src/handler.py --rp_serve_api --rp_api_host 0.0.0.0 --rp_log_level DEBUG
  1. Test the project
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"}'

Tag summary

Content type

Image

Digest

sha256:c0c37d587…

Size

14.9 GB

Last updated

almost 2 years ago

docker pull adimyth/serverless-s2t-indic-conformer:v1.2.0