hackergeek98 commited on
Commit
fb40e69
·
verified ·
1 Parent(s): ab0c982

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,4 +1,6 @@
1
  # Install required packages
 
 
2
  import torch
3
  from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
4
  from pydub import AudioSegment
@@ -58,11 +60,11 @@ def transcribe_interface(audio_file):
58
 
59
  iface = gr.Interface(
60
  fn=transcribe_interface,
61
- inputs=gr.Audio(source="upload", type="filepath"),
62
  outputs="text",
63
  title="Whisper ASR - Transcription",
64
  description="Upload an audio file, and the model will transcribe it."
65
  )
66
 
67
  if __name__ == "__main__":
68
- iface.launch()
 
1
  # Install required packages
2
+ !pip install torch torchaudio transformers pydub gradio
3
+
4
  import torch
5
  from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
6
  from pydub import AudioSegment
 
60
 
61
  iface = gr.Interface(
62
  fn=transcribe_interface,
63
+ inputs=gr.Audio(type="filepath"),
64
  outputs="text",
65
  title="Whisper ASR - Transcription",
66
  description="Upload an audio file, and the model will transcribe it."
67
  )
68
 
69
  if __name__ == "__main__":
70
+ iface.launch()