Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ from transformers import WhisperProcessor, WhisperForConditionalGeneration, Auto
|
|
| 6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 7 |
|
| 8 |
# Whisper model for language detection
|
| 9 |
-
lang_id_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large
|
| 10 |
-
lang_id_processor = WhisperProcessor.from_pretrained("openai/whisper-large
|
| 11 |
|
| 12 |
# Indic Conformer model for transcription
|
| 13 |
model = AutoModel.from_pretrained("ai4bharat/indic-conformer-600m-multilingual", trust_remote_code=True)
|
|
@@ -51,7 +51,7 @@ demo = gr.Interface(
|
|
| 51 |
gr.Textbox(label="RNNT Transcription")
|
| 52 |
],
|
| 53 |
title="Language-Aware Transcription_2",
|
| 54 |
-
description="Step 1: Detect language using Whisper-Large
|
| 55 |
)
|
| 56 |
|
| 57 |
if __name__ == "__main__":
|
|
|
|
| 6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 7 |
|
| 8 |
# Whisper model for language detection
|
| 9 |
+
lang_id_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large").to(device)
|
| 10 |
+
lang_id_processor = WhisperProcessor.from_pretrained("openai/whisper-large")
|
| 11 |
|
| 12 |
# Indic Conformer model for transcription
|
| 13 |
model = AutoModel.from_pretrained("ai4bharat/indic-conformer-600m-multilingual", trust_remote_code=True)
|
|
|
|
| 51 |
gr.Textbox(label="RNNT Transcription")
|
| 52 |
],
|
| 53 |
title="Language-Aware Transcription_2",
|
| 54 |
+
description="Step 1: Detect language using Whisper-Large. Step 2: Transcribe using AI4Bharat Indic Conformer."
|
| 55 |
)
|
| 56 |
|
| 57 |
if __name__ == "__main__":
|