Spaces:
Runtime error
Runtime error
remove translate option
Browse files
app.py
CHANGED
|
@@ -27,24 +27,25 @@ def transcribe(inputs, task):
|
|
| 27 |
text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
|
| 28 |
return text
|
| 29 |
|
| 30 |
-
# Removed microphone transcription interface
|
| 31 |
-
|
| 32 |
demo = gr.Blocks()
|
| 33 |
|
| 34 |
-
# Keep only the file upload transcription interface
|
| 35 |
file_transcribe = gr.Interface(
|
| 36 |
fn=transcribe,
|
| 37 |
inputs=[
|
| 38 |
gr.Audio(sources="upload", type="filepath", label="Audio file"),
|
| 39 |
-
gr.Radio(["transcribe"
|
| 40 |
],
|
| 41 |
outputs="text",
|
| 42 |
title="Whisper Large V3: Transcribe Audio",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
allow_flagging="never",
|
| 44 |
)
|
| 45 |
|
| 46 |
with demo:
|
| 47 |
-
# Only include the file upload tab
|
| 48 |
gr.TabbedInterface([file_transcribe], ["Audio file"])
|
| 49 |
|
| 50 |
demo.queue().launch(share=True)
|
|
|
|
| 27 |
text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
|
| 28 |
return text
|
| 29 |
|
|
|
|
|
|
|
| 30 |
demo = gr.Blocks()
|
| 31 |
|
|
|
|
| 32 |
file_transcribe = gr.Interface(
|
| 33 |
fn=transcribe,
|
| 34 |
inputs=[
|
| 35 |
gr.Audio(sources="upload", type="filepath", label="Audio file"),
|
| 36 |
+
gr.Radio(["transcribe"], label="Task", value="transcribe"),
|
| 37 |
],
|
| 38 |
outputs="text",
|
| 39 |
title="Whisper Large V3: Transcribe Audio",
|
| 40 |
+
description=(
|
| 41 |
+
"Transcribe long-form audio files! Demo uses the"
|
| 42 |
+
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
| 43 |
+
" of arbitrary length."
|
| 44 |
+
),
|
| 45 |
allow_flagging="never",
|
| 46 |
)
|
| 47 |
|
| 48 |
with demo:
|
|
|
|
| 49 |
gr.TabbedInterface([file_transcribe], ["Audio file"])
|
| 50 |
|
| 51 |
demo.queue().launch(share=True)
|