Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ from transformers import XLMRobertaTokenizerFast, XLMRobertaForSequenceClassific
|
|
8 |
import soundfile as sf
|
9 |
|
10 |
# --- Load models ---
|
11 |
-
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-
|
12 |
-
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-
|
13 |
|
14 |
lang_tokenizer = XLMRobertaTokenizerFast.from_pretrained("papluca/xlm-roberta-base-language-detection")
|
15 |
lang_model = XLMRobertaForSequenceClassification.from_pretrained("papluca/xlm-roberta-base-language-detection")
|
@@ -70,8 +70,8 @@ iface = gr.Interface(
|
|
70 |
fn=detect_language_from_audio,
|
71 |
inputs=gr.Audio(type="filepath", label="Choose Audio File (WAV/MP3)"),
|
72 |
outputs=gr.Textbox(label="Result"),
|
73 |
-
title="🎙️ Voice Language Detector",
|
74 |
-
description="Upload
|
75 |
)
|
76 |
|
77 |
# --- Entry point ---
|
|
|
8 |
import soundfile as sf
|
9 |
|
10 |
# --- Load models ---
|
11 |
+
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-tiny")
|
12 |
+
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-tiny")
|
13 |
|
14 |
lang_tokenizer = XLMRobertaTokenizerFast.from_pretrained("papluca/xlm-roberta-base-language-detection")
|
15 |
lang_model = XLMRobertaForSequenceClassification.from_pretrained("papluca/xlm-roberta-base-language-detection")
|
|
|
70 |
fn=detect_language_from_audio,
|
71 |
inputs=gr.Audio(type="filepath", label="Choose Audio File (WAV/MP3)"),
|
72 |
outputs=gr.Textbox(label="Result"),
|
73 |
+
title="🎙️ Fast Voice Language Detector",
|
74 |
+
description="Upload an audio file and get the detected language instantly using Whisper-Tiny + XLM-Roberta."
|
75 |
)
|
76 |
|
77 |
# --- Entry point ---
|