Futuresony commited on
Commit
af87fba
·
verified ·
1 Parent(s): b3a902e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -3,7 +3,7 @@ import torch
3
  import torchaudio
4
  from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
5
 
6
- # Load your model from Hugging Face
7
  model_name = "Futuresony/Future-sw_ASR-24-02-2025"
8
  processor = Wav2Vec2Processor.from_pretrained(model_name)
9
  model = Wav2Vec2ForCTC.from_pretrained(model_name)
@@ -29,9 +29,9 @@ def transcribe_live(microphone_audio):
29
  # Create Gradio interface with live microphone input
30
  interface = gr.Interface(
31
  fn=transcribe_live,
32
- inputs=gr.Audio(source="microphone", type="filepath"),
33
  outputs="text",
34
- live=True, # Enables real-time updates
35
  title="Live Swahili ASR Transcription",
36
  description="Speak into your microphone, and the model will transcribe in real-time.",
37
  )
@@ -39,4 +39,3 @@ interface = gr.Interface(
39
  # Launch the app
40
  if __name__ == "__main__":
41
  interface.launch()
42
-
 
3
  import torchaudio
4
  from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
5
 
6
+ # Load the Swahili ASR model
7
  model_name = "Futuresony/Future-sw_ASR-24-02-2025"
8
  processor = Wav2Vec2Processor.from_pretrained(model_name)
9
  model = Wav2Vec2ForCTC.from_pretrained(model_name)
 
29
  # Create Gradio interface with live microphone input
30
  interface = gr.Interface(
31
  fn=transcribe_live,
32
+ inputs=gr.Audio(sources=["microphone"], type="filepath"),
33
  outputs="text",
34
+ live=True,
35
  title="Live Swahili ASR Transcription",
36
  description="Speak into your microphone, and the model will transcribe in real-time.",
37
  )
 
39
  # Launch the app
40
  if __name__ == "__main__":
41
  interface.launch()