Sign inSign up

adimyth/serverless-s2t-indic-wav2vec

By adimyth

•Updated almost 2 years ago

A serverless deployment of AI4Bharat's Indic language Automatic Speech Recognition (ASR) models.

Image
Machine learning & AI
0

497

adimyth/serverless-s2t-indic-wav2vec repository overview

⁠Deploying Huggingface Models on RunPod

⁠Running the project
  1. Clone the repository
  2. Install the requirements
pip install -r builder/requirements.txt
  1. Run the project. Refer the docs⁠ for more options. 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 '{
  "input": {"sentence": "प्रत्येक व्यक्ति को शिक्षा का अधिकार है । शिक्षा कम से कम प्रारम्भिक और बुनियादी अवस्थाओं में निःशुल्क होगी ।", "language": "hi"}
}'

Important

It seems as if the `runsync` endpoint only returns JSON Response, even though it uses FastAPI to serve the model as an API. Hence, in the handler I have added an additional step to store the file to S3 & return the CDN URL. This is a workaround to the issue.

Note

I am passing the AWS Creds (refer `src/.env.example`) as secrets. Runpod requires secrets to be prefixed with `RUNPOD_SECRET_`. Refer the [docs](https://docs.runpod.io/pods/templates/secrets) for more information.

Tag summary

Content type

Image

Digest

sha256:b41191f5e…

Size

7.1 GB

Last updated

almost 2 years ago

docker pull adimyth/serverless-s2t-indic-wav2vec:v1.0.0