akki2825 commited on
Commit
e73ecef
·
verified ·
1 Parent(s): c7227e3

remove task

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -11,7 +11,6 @@ BATCH_SIZE = 8
11
 
12
 
13
  pipe = pipeline(
14
- task="automatic-speech-recognition",
15
  model=MODEL_NAME,
16
  chunk_length_s=30,
17
  )
@@ -20,7 +19,7 @@ pipe = pipeline(
20
  def transcribe(inputs, task):
21
  if inputs is None:
22
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
23
- text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
24
  return text
25
 
26
  demo = gr.Blocks()
@@ -29,7 +28,6 @@ file_transcribe = gr.Interface(
29
  fn=transcribe,
30
  inputs=[
31
  gr.Audio(sources="upload", type="filepath", label="Audio file"),
32
- gr.Radio(["transcribe"], label="Task", value="transcribe"),
33
  ],
34
  outputs="text",
35
  title="Whisper small.en: Transcribe Audio",
 
11
 
12
 
13
  pipe = pipeline(
 
14
  model=MODEL_NAME,
15
  chunk_length_s=30,
16
  )
 
19
  def transcribe(inputs, task):
20
  if inputs is None:
21
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
22
+ text = pipe(inputs, batch_size=BATCH_SIZE, return_timestamps=True)["text"]
23
  return text
24
 
25
  demo = gr.Blocks()
 
28
  fn=transcribe,
29
  inputs=[
30
  gr.Audio(sources="upload", type="filepath", label="Audio file"),
 
31
  ],
32
  outputs="text",
33
  title="Whisper small.en: Transcribe Audio",