ranialahassn commited on
Commit
5d42200
·
verified ·
1 Parent(s): eb2b7f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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-base")
12
- whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
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 a voice file and the model will detect its language using Whisper + XLM-Roberta."
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 ---