axxam commited on
Commit
c002cde
·
verified ·
1 Parent(s): 286eb75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -2,7 +2,6 @@ import torch
2
  import gradio as gr
3
  import pytube as pt
4
  from transformers import pipeline
5
- from huggingface_hub import model_info
6
 
7
  MODEL_NAME = "BlueRaccoon/whisper-small-kab" # this always needs to stay in line 8 :D sorry for the hackiness
8
  lang = "uz"
@@ -66,15 +65,13 @@ with gr.Blocks() as demo:
66
  of arbitrary length.
67
  """
68
  )
69
- audio_inputs = [
70
- gr.Audio(source="microphone", type="filepath", label="Record from Microphone"),
71
- gr.Audio(source="upload", type="filepath", label="Upload Audio File"),
72
- ]
73
  gr.Interface(
74
  fn=transcribe,
75
- inputs=audio_inputs,
76
  outputs=gr.Textbox(label="Transcription"),
77
- live=False,
78
  )
79
 
80
  with gr.Tab("Transcribe YouTube"):
@@ -91,7 +88,6 @@ with gr.Blocks() as demo:
91
  fn=yt_transcribe,
92
  inputs=[yt_url_input],
93
  outputs=[gr.HTML(label="YouTube Video"), gr.Textbox(label="Transcription")],
94
- live=False,
95
  )
96
 
97
  demo.launch(enable_queue=True)
 
2
  import gradio as gr
3
  import pytube as pt
4
  from transformers import pipeline
 
5
 
6
  MODEL_NAME = "BlueRaccoon/whisper-small-kab" # this always needs to stay in line 8 :D sorry for the hackiness
7
  lang = "uz"
 
65
  of arbitrary length.
66
  """
67
  )
68
+ # Inputs for microphone recording or file upload
69
+ microphone_input = gr.Audio(type="filepath", label="Record or Upload Audio")
70
+ file_upload_input = gr.Audio(type="filepath", label="Upload Audio File (Optional)")
 
71
  gr.Interface(
72
  fn=transcribe,
73
+ inputs=[microphone_input, file_upload_input],
74
  outputs=gr.Textbox(label="Transcription"),
 
75
  )
76
 
77
  with gr.Tab("Transcribe YouTube"):
 
88
  fn=yt_transcribe,
89
  inputs=[yt_url_input],
90
  outputs=[gr.HTML(label="YouTube Video"), gr.Textbox(label="Transcription")],
 
91
  )
92
 
93
  demo.launch(enable_queue=True)