Shanuka01 commited on
Commit
691851d
·
1 Parent(s): f6ea9c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -5,7 +5,7 @@ from transformers import pipeline
5
  model_id = "openai/whisper-tiny" # Using the model you provided
6
  pipe = pipeline("automatic-speech-recognition", model=model_id)
7
 
8
- title = "Automatic Speech Recognition (ASR)"
9
  description = """
10
  """
11
 
@@ -22,21 +22,13 @@ def transcribe_speech(filepath):
22
  )
23
  return output["text"]
24
 
25
- demo = gr.Blocks()
26
-
27
  file_transcribe = gr.Interface(
28
  fn=transcribe_speech,
29
  inputs=gr.Audio(source="upload", type="filepath"),
30
  outputs=gr.outputs.Textbox(),
31
  examples=[["./example.wav"]],
32
- title=title, # Fixed typo (tilte -> title)
33
  description=description,
34
  )
35
 
36
- with demo:
37
- gr.TabbedInterface(
38
- [file_transcribe],
39
- ["Transcribe Audio File"],
40
- ),
41
-
42
- demo.launch()
 
5
  model_id = "openai/whisper-tiny" # Using the model you provided
6
  pipe = pipeline("automatic-speech-recognition", model=model_id)
7
 
8
+ title = "Automatic Speech Recognition"
9
  description = """
10
  """
11
 
 
22
  )
23
  return output["text"]
24
 
 
 
25
  file_transcribe = gr.Interface(
26
  fn=transcribe_speech,
27
  inputs=gr.Audio(source="upload", type="filepath"),
28
  outputs=gr.outputs.Textbox(),
29
  examples=[["./example.wav"]],
30
+ title=title,
31
  description=description,
32
  )
33
 
34
+ file_transcribe.launch()