hotfix 1.4
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from faster_whisper import WhisperModel
|
|
4 |
|
5 |
import gradio as gr
|
6 |
import yt_dlp as youtube_dl
|
7 |
-
|
8 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
9 |
|
10 |
import tempfile
|
@@ -17,13 +17,6 @@ YT_LENGTH_LIMIT_S = 600 # limit to 1 hour YouTube files
|
|
17 |
|
18 |
device = 0 if torch.cuda.is_available() else "cpu"
|
19 |
|
20 |
-
pipe = pipeline(
|
21 |
-
task="automatic-speech-recognition",
|
22 |
-
model=MODEL_NAME,
|
23 |
-
chunk_length_s=30,
|
24 |
-
device=device,
|
25 |
-
)
|
26 |
-
|
27 |
model = WhisperModel(MODEL_NAME, device=device, compute_type="float16" if device == "cuda" else "int8")
|
28 |
|
29 |
@spaces.GPU
|
@@ -140,9 +133,7 @@ yt_transcribe = gr.Interface(
|
|
140 |
outputs=["html", "text"],
|
141 |
title="Verbalens Project: Demo 1 prototype",
|
142 |
description=(
|
143 |
-
"Transcribe long-form videos with the click of a button! Demo uses the checkpoint"
|
144 |
-
f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}), Nemo Diarization and Transformers to transcribe video files of"
|
145 |
-
" arbitrary length."
|
146 |
),
|
147 |
allow_flagging="never",
|
148 |
)
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
import yt_dlp as youtube_dl
|
7 |
+
|
8 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
9 |
|
10 |
import tempfile
|
|
|
17 |
|
18 |
device = 0 if torch.cuda.is_available() else "cpu"
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
model = WhisperModel(MODEL_NAME, device=device, compute_type="float16" if device == "cuda" else "int8")
|
21 |
|
22 |
@spaces.GPU
|
|
|
133 |
outputs=["html", "text"],
|
134 |
title="Verbalens Project: Demo 1 prototype",
|
135 |
description=(
|
136 |
+
"Transcribe long-form videos with the click of a button! Demo uses the checkpoint Nemo Diarization and Transformers to transcribe video files of arbitrary length."
|
|
|
|
|
137 |
),
|
138 |
allow_flagging="never",
|
139 |
)
|