From 1294b3c43d778527f440f500a22886370ac9b4d4 Mon Sep 17 00:00:00 2001 From: Shruti1229 Date: Thu, 27 Jul 2023 11:33:30 +0530 Subject: [PATCH] Provide service ids --- backend/config.py | 3 +++ backend/transcript/utils/asr.py | 15 +++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/backend/config.py b/backend/config.py index f64c1d3a..44c6e9ab 100644 --- a/backend/config.py +++ b/backend/config.py @@ -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") diff --git a/backend/transcript/utils/asr.py b/backend/transcript/utils/asr.py index 870fb4e1..ccbdc633 100644 --- a/backend/transcript/utils/asr.py +++ b/backend/transcript/utils/asr.py @@ -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 @@ -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