Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,15 +5,16 @@ import pytube as pt
|
|
5 |
from transformers import pipeline
|
6 |
from huggingface_hub import model_info
|
7 |
|
8 |
-
MODEL_NAME = "
|
9 |
-
lang = "
|
10 |
|
11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
12 |
pipe = pipeline(
|
13 |
task="automatic-speech-recognition",
|
14 |
-
model=
|
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="transcribe")
|
@@ -67,7 +68,7 @@ mf_transcribe = gr.Interface(
|
|
67 |
outputs="text",
|
68 |
layout="horizontal",
|
69 |
theme="huggingface",
|
70 |
-
title="
|
71 |
description=(
|
72 |
"Transcribe 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,7 +83,7 @@ yt_transcribe = gr.Interface(
|
|
82 |
outputs=["html", "text"],
|
83 |
layout="horizontal",
|
84 |
theme="huggingface",
|
85 |
-
title="
|
86 |
description=(
|
87 |
"Transcribe 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"
|
|
|
5 |
from transformers import pipeline
|
6 |
from huggingface_hub import model_info
|
7 |
|
8 |
+
MODEL_NAME = "spygaurad/nepali-speech-to-text" #this always needs to stay in line 8 :D sorry for the hackiness
|
9 |
+
lang = "ne"
|
10 |
|
11 |
device = 0 if torch.cuda.is_available() else "cpu"
|
12 |
pipe = pipeline(
|
13 |
task="automatic-speech-recognition",
|
14 |
+
model=model,
|
15 |
chunk_length_s=30,
|
16 |
device=device,
|
17 |
+
tokenizer=
|
18 |
)
|
19 |
|
20 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
|
|
68 |
outputs="text",
|
69 |
layout="horizontal",
|
70 |
theme="huggingface",
|
71 |
+
title="Nepali Transcribe Audio",
|
72 |
description=(
|
73 |
"Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
|
74 |
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
|
|
83 |
outputs=["html", "text"],
|
84 |
layout="horizontal",
|
85 |
theme="huggingface",
|
86 |
+
title="Nepali Transcribe YouTube",
|
87 |
description=(
|
88 |
"Transcribe long-form YouTube videos with the click of a button! Demo uses the the fine-tuned checkpoint:"
|
89 |
f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
|