BoburAmirov commited on
Commit
7c673ba
1 Parent(s): c7ff04d

input Audio change

Browse files
Files changed (1) hide show
  1. app.py +39 -39
app.py CHANGED
@@ -121,32 +121,32 @@ def yt_transcribe(yt_url, task, return_timestamps, language, max_filesize=75.0):
121
 
122
  demo = gr.Blocks()
123
 
124
- mf_transcribe = gr.Interface(
125
- fn=transcribe,
126
- inputs=[
127
- gr.Audio(sources=["microphone"], type="filepath"),
128
- gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
129
- gr.inputs.Checkbox(label="Return timestamps"),
130
- gr.inputs.Dropdown(choices=["English", "Uzbek"], label="Language"),
131
- ],
132
- outputs="text",
133
- layout="horizontal",
134
- theme="huggingface",
135
- title="Whisper Large V3 Uzbek: Transcribe Audio",
136
- description=(
137
- "\n\n"
138
- "<center>⭐️Brought to you by <a href='https://note.com/sangmin/n/n9813f2064a6a'>Chiomirai School</a>⭐️</center>"
139
- ),
140
- allow_flagging="never",
141
- )
142
 
143
  file_transcribe = gr.Interface(
144
  fn=transcribe,
145
  inputs=[
146
  gr.Audio(sources=["upload"], type="filepath", label="Audio file"),
147
- gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
148
- gr.inputs.Checkbox(label="Return timestamps"),
149
- gr.inputs.Dropdown(choices=["English", "Uzbek"], label="Language"),
150
  ],
151
  outputs="text",
152
  layout="horizontal",
@@ -159,24 +159,24 @@ file_transcribe = gr.Interface(
159
  allow_flagging="never",
160
  )
161
 
162
- yt_transcribe = gr.Interface(
163
- fn=yt_transcribe,
164
- inputs=[
165
- gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
166
- gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
167
- gr.inputs.Checkbox(label="Return timestamps"),
168
- gr.inputs.Dropdown(choices=["English", "Uzbek"], label="Language"),
169
- ],
170
- outputs=["html", "text"],
171
- layout="horizontal",
172
- theme="huggingface",
173
- title="Whisper Large V3 Uzbek: Transcribe YouTube",
174
- description=(
175
- "\n\n"
176
- "<center>⭐️Brought to you by <a href='https://note.com/sangmin/n/n9813f2064a6a'>Chiomirai School</a>⭐️</center>"
177
- ),
178
- allow_flagging="never",
179
- )
180
 
181
  with demo:
182
  gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
 
121
 
122
  demo = gr.Blocks()
123
 
124
+ # mf_transcribe = gr.Interface(
125
+ # fn=transcribe,
126
+ # inputs=[
127
+ # gr.Audio(sources=["microphone"], type="filepath"),
128
+ # gr.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
129
+ # gr.Checkbox(label="Return timestamps"),
130
+ # gr.Dropdown(choices=["English", "Uzbek"], label="Language"),
131
+ # ],
132
+ # outputs="text",
133
+ # layout="horizontal",
134
+ # theme="huggingface",
135
+ # title="Whisper Large V3 Uzbek: Transcribe Audio",
136
+ # description=(
137
+ # "\n\n"
138
+ # "<center>⭐️Brought to you by <a href='https://note.com/sangmin/n/n9813f2064a6a'>Chiomirai School</a>⭐️</center>"
139
+ # ),
140
+ # allow_flagging="never",
141
+ # )
142
 
143
  file_transcribe = gr.Interface(
144
  fn=transcribe,
145
  inputs=[
146
  gr.Audio(sources=["upload"], type="filepath", label="Audio file"),
147
+ gr.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
148
+ gr.Checkbox(label="Return timestamps"),
149
+ gr.Dropdown(choices=["English", "Uzbek"], label="Language"),
150
  ],
151
  outputs="text",
152
  layout="horizontal",
 
159
  allow_flagging="never",
160
  )
161
 
162
+ # yt_transcribe = gr.Interface(
163
+ # fn=yt_transcribe,
164
+ # inputs=[
165
+ # gr.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
166
+ # gr.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
167
+ # gr.Checkbox(label="Return timestamps"),
168
+ # gr.Dropdown(choices=["English", "Uzbek"], label="Language"),
169
+ # ],
170
+ # outputs=["html", "text"],
171
+ # layout="horizontal",
172
+ # theme="huggingface",
173
+ # title="Whisper Large V3 Uzbek: Transcribe YouTube",
174
+ # description=(
175
+ # "\n\n"
176
+ # "<center>⭐️Brought to you by <a href='https://note.com/sangmin/n/n9813f2064a6a'>Chiomirai School</a>⭐️</center>"
177
+ # ),
178
+ # allow_flagging="never",
179
+ # )
180
 
181
  with demo:
182
  gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])