UNSAFESUPERINTELLIGENCE commited on
Commit
2b2237c
·
1 Parent(s): 41c21b3

Fix Python linting issues

Browse files
Files changed (2) hide show
  1. app.py +7 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -4,13 +4,18 @@ from faster_whisper import WhisperModel
4
  model = WhisperModel("large-v3", device="cuda", compute_type="float16")
5
 
6
  def transcribe(gradio_input_one_return_audio_filepath: str, gradio_input_two_return_beam_size: int):
7
- segments, info = model.transcribe(audio_path, beam_size=5, language="en")
 
 
 
 
 
8
  return f"```{info}```", "\n".join([seg.text for seg in segments])
9
 
10
  interface = gr.Interface(
11
  fn = transcribe,
12
  inputs = [
13
- gr.Audio(type="filepath", label="Upload audio"),
14
  gr.Slider(minimum = 1, maximum = 10, value = 5, step = 1, label="Beam size"),
15
  ],
16
  outputs = [
@@ -21,4 +26,3 @@ interface = gr.Interface(
21
  )
22
 
23
  interface.queue().launch()
24
-
 
4
  model = WhisperModel("large-v3", device="cuda", compute_type="float16")
5
 
6
  def transcribe(gradio_input_one_return_audio_filepath: str, gradio_input_two_return_beam_size: int):
7
+ """Makes a call to transcribe the audio"""
8
+ segments, info = model.transcribe(
9
+ gradio_input_one_return_audio_filepath,
10
+ beam_size=gradio_input_two_return_beam_size,
11
+ language="en"
12
+ )
13
  return f"```{info}```", "\n".join([seg.text for seg in segments])
14
 
15
  interface = gr.Interface(
16
  fn = transcribe,
17
  inputs = [
18
+ gr.Audio(type="filepath", label="Upload audio"),
19
  gr.Slider(minimum = 1, maximum = 10, value = 5, step = 1, label="Beam size"),
20
  ],
21
  outputs = [
 
26
  )
27
 
28
  interface.queue().launch()
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio>= 5.30.0
2
  faster-whisper
3
  ctranslate2
4
  ffmpeg-python
 
1
+ gradio>=5.30.0
2
  faster-whisper
3
  ctranslate2
4
  ffmpeg-python