Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,13 +10,13 @@ lang = "ta"
|
|
| 10 |
|
| 11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
| 12 |
pipe = pipeline(
|
| 13 |
-
task="
|
| 14 |
model=MODEL_NAME,
|
| 15 |
chunk_length_s=30,
|
| 16 |
device=device,
|
| 17 |
)
|
| 18 |
|
| 19 |
-
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="
|
| 20 |
|
| 21 |
def transcribe(microphone, file_upload):
|
| 22 |
warn_output = ""
|
|
@@ -67,7 +67,7 @@ mf_transcribe = gr.Interface(
|
|
| 67 |
outputs="text",
|
| 68 |
layout="horizontal",
|
| 69 |
theme="huggingface",
|
| 70 |
-
title="Whisper Small Tamil Demo:
|
| 71 |
description=(
|
| 72 |
"Translate long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
|
| 73 |
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
|
@@ -82,9 +82,9 @@ yt_transcribe = gr.Interface(
|
|
| 82 |
outputs=["html", "text"],
|
| 83 |
layout="horizontal",
|
| 84 |
theme="huggingface",
|
| 85 |
-
title="Whisper Small Tamil Demo:
|
| 86 |
description=(
|
| 87 |
-
"
|
| 88 |
f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
|
| 89 |
" arbitrary length."
|
| 90 |
),
|
|
@@ -92,6 +92,6 @@ yt_transcribe = gr.Interface(
|
|
| 92 |
)
|
| 93 |
|
| 94 |
with demo:
|
| 95 |
-
gr.TabbedInterface([mf_transcribe, yt_transcribe], ["
|
| 96 |
|
| 97 |
demo.launch(enable_queue=True)
|
|
|
|
| 10 |
|
| 11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
| 12 |
pipe = pipeline(
|
| 13 |
+
task="translate",
|
| 14 |
model=MODEL_NAME,
|
| 15 |
chunk_length_s=30,
|
| 16 |
device=device,
|
| 17 |
)
|
| 18 |
|
| 19 |
+
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="translate")
|
| 20 |
|
| 21 |
def transcribe(microphone, file_upload):
|
| 22 |
warn_output = ""
|
|
|
|
| 67 |
outputs="text",
|
| 68 |
layout="horizontal",
|
| 69 |
theme="huggingface",
|
| 70 |
+
title="Whisper Small Tamil Demo: Translate Audio",
|
| 71 |
description=(
|
| 72 |
"Translate long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
|
| 73 |
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
|
|
|
| 82 |
outputs=["html", "text"],
|
| 83 |
layout="horizontal",
|
| 84 |
theme="huggingface",
|
| 85 |
+
title="Whisper Small Tamil Demo: translate YouTube",
|
| 86 |
description=(
|
| 87 |
+
"Translate long-form YouTube videos with the click of a button! Demo uses the the fine-tuned checkpoint:"
|
| 88 |
f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
|
| 89 |
" arbitrary length."
|
| 90 |
),
|
|
|
|
| 92 |
)
|
| 93 |
|
| 94 |
with demo:
|
| 95 |
+
gr.TabbedInterface([mf_transcribe, yt_transcribe], ["translate Audio", "translate YouTube"])
|
| 96 |
|
| 97 |
demo.launch(enable_queue=True)
|