Coder Social home page Coder Social logo

indic-asr-api-backend's Introduction

Indic ASR API

Installation Instructions

conda create -n ai4b_asr python=3.8
conda activate ai4b_asr
pip install torch torchvision torchaudio
git clone https://github.com/NVIDIA/NeMo.git
cd NeMo
bash reinstall.sh
cd ..
git clone https://github.com/AI4Bharat/indic-asr-api-backend.git
cd indic-asr-api-backend
pip install -r requirements.txt

Download models

mkdir -p models
wget -P models https://objectstore.e2enetworks.net/indic-asr-public/external/checkpoints/english/en-conformer-ctc.nemo
wget -P models https://objectstore.e2enetworks.net/indic-asr-public/checkpoints/conformer/stt_hi_conformer_ctc_large_v2.nemo

Usage

Starting the server:

python api.py

This will start the server on port 4992. Keep this process running. You can modify the PORT in api.py.

Running inference:

Here we show how to access the API using an example (on a new terminal) -

python example_ai4b_asr_rest_api.py

Output:

Play Audio

Response: <Response [200]>
Text: deposit five thousand rupees in my bank account

Deployment using Triton-Inference-Server

Refer to serving page for more details!

indic-asr-api-backend's People

Contributors

kaushal-py avatar ramanhacks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

indic-asr-api-backend's Issues

Installation Failure for megatron-core==0.4.0 due to Missing requirements.txt

Issue Summary:

While installing nemo_toolkit==1.23.0rc0, the installation of megatron-core==0.4.0 dependency fails due to a FileNotFoundError for megatron/core/requirements.txt.

Steps to Reproduce:

  1. Run a script (reinstall.sh) that attempts to install nemo_toolkit==1.23.0rc0.
  2. The installation process starts normally, installing/updating various packages.
  3. Upon reaching megatron-core==0.4.0, the installation fails.

Expected Behavior:

The megatron-core package should install without errors.

Actual Behavior:

The installation process fails with the following error message:

Collecting megatron-core==0.4.0 (from nemo_toolkit==1.23.0rc0)
  Using cached megatron_core-0.4.0.tar.gz (154 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "/home/centos/miniconda3/envs/ai4b_asr/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/centos/miniconda3/envs/ai4b_asr/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/centos/miniconda3/envs/ai4b_asr/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-9fq_ra8j/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-9fq_ra8j/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-9fq_ra8j/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-9fq_ra8j/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 52, in <module>
        File "<string>", line 45, in req_file
      FileNotFoundError: [Errno 2] No such file or directory: 'megatron/core/requirements.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

This error is triggered during the step of "Getting requirements to build wheel" for the megatron-core package.

Environment:

  • OS: centOS
  • Python version: 3.8
  • Conda environment

Additional Context:

The issue seems to be related to a missing requirements.txt file in the megatron-core package. This error might indicate an issue with the package structure or setup script of megatron-core.

Possible Solutions:

  • Verification of the megatron-core package contents to ensure requirements.txt is correctly included.
  • Review and update the installation script if necessary.

I am seeking assistance in resolving this issue to successfully install nemo_toolkit==1.23.0rc0.

Thank you for your attention to this matter.

"PostProcessors" and "number_mode" Issue

Hello
We are trying to get numeric data from hindi input audio (i.e If I say "satra","pachhis" ,it should return 17,25 respectively ).By just passing audio, language = hi ,it is giving some random text
So Is there any way to trancribe hindi numbers?
I'm trying in the following two ways , but we had following queries :

  1. In the "api.py" file . I have seen number_mode = float(req_data.get('number_mode',False)) line
    But the parameter "number_mode" is not passing to any function
    How to use it?

  2. In the "example_ai4b_asr_rest_api.py" file ,it has been given that the data should be in the following format
    data = { "config": { "language": { "sourceLanguage": "en" }, "transcriptionFormat": { "value": "transcript" }, "audioFormat": "wav", "samplingRate": "16000", "postProcessors": None }, "audio": [ { "audioContent": encoded_string } ] }
    What does the term "postProcessors" mean and how to use it?

Is there any other way to get numeric values for Indian languages

Unable to download models

Hi,
I wanted to try your model but I am unable to download git lfs model checkpoints.

While trying to run:

git clone https://github.com/AI4Bharat/indic-asr-api-backend.git

I get the error:

Cloning into 'indic-asr-api-backend'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 111 (delta 26), reused 92 (delta 18), pack-reused 0
Receiving objects: 100% (111/111), 27.80 KiB | 13.90 MiB/s, done.
Resolving deltas: 100% (26/26), done.
Downloading serving/dr/model_repository/asr_am/1/model.pt (507 MB)
Error downloading object: serving/dr/model_repository/asr_am/1/model.pt (cb0d180): Smudge error: Error downloading serving/dr/model_repository/asr_am/1/model.pt (cb0d180d5b29eae890cbe692d71449bf88c417ae1dd36e84e2897ac5ebeaa3e5): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

I think this is happening because github allows limited storage and bandwidth.

I had a few questions:

  1. Is there a specific reason why you need to use git lfs? Can't you simply upload the checkpoints on a drive just like you did with nemo checkpoints?
  2. Do you plan to release nemo checkpoints for models other than hindi and english?

Thanks!

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.