josh-salako commited on
Commit
f30a133
·
1 Parent(s): ddae831

added upload feature

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,14 +14,14 @@ model = WhisperModel("tiny",
14
 
15
  def transcribe(audio):
16
  # Transcribe audio using faster-whisper
17
- segments, _ = model.transcribe(audio)
18
  # Combine all segments into one text
19
  result = " ".join([segment.text for segment in segments])
20
  return result
21
 
22
  iface = gr.Interface(
23
  fn=transcribe,
24
- inputs=gr.Audio(sources="microphone", type="filepath"),
25
  outputs="text",
26
  live=True,
27
  title="Speech-to-Text Demo",
 
14
 
15
  def transcribe(audio):
16
  # Transcribe audio using faster-whisper
17
+ segments, _ = model.transcribe(audio, language="yo")
18
  # Combine all segments into one text
19
  result = " ".join([segment.text for segment in segments])
20
  return result
21
 
22
  iface = gr.Interface(
23
  fn=transcribe,
24
+ inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"),
25
  outputs="text",
26
  live=True,
27
  title="Speech-to-Text Demo",