Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide service ids #424

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
dhruva_key = os.getenv("DHRUVA_KEY")
english_asr_url = os.getenv("ENGLISH_ASR_API_URL")
indic_asr_url = os.getenv("INDIC_ASR_API_URL")
service_id_hindi = SERVICE_ID_HINDI
service_id_indo_aryan = SERVICE_ID_INDO_ARYAN
service_id_dravidian = SERVICE_ID_DRAVIDIAN
misc_tts_url = os.getenv("MISC_TTS_API_URL")
indo_aryan_tts_url = os.getenv("INDO_ARYAN_TTS_API_URL")
dravidian_tts_url = os.getenv("DRAVIDIAN_TTS_API_URL")
Expand Down
15 changes: 11 additions & 4 deletions backend/transcript/utils/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import traceback
import requests
import logging
from config import english_asr_url, indic_asr_url, dhruva_key
from config import (
english_asr_url,
indic_asr_url,
dhruva_key,
service_id_hindi,
service_id_indo_aryan,
service_id_dravidian,
)
import subprocess
import json

Expand Down Expand Up @@ -40,11 +47,11 @@ def make_asr_api_call(url, lang, vad_level=3, chunk_size=10):
return None
else:
if lang == "hi":
service_id = "ai4bharat/conformer-hi-gpu--t4"
service_id = service_id_hindi
elif lang in ["bn", "gu", "mr", "or", "pa", "sa", "ur"]:
service_id = "ai4bharat/conformer-multilingual-indo_aryan-gpu--t4"
service_id = service_id_indo_aryan
elif lang in ["kn", "ml", "ta", "te"]:
service_id = "ai4bharat/conformer-multilingual-dravidian-gpu--t4"
service_id = service_id_dravidian
else:
return None

Expand Down
Loading