Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
112f258
1
Parent(s):
bd28ac3
Change model to turbo
Browse files
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
app.py
CHANGED
|
@@ -14,18 +14,19 @@ from dotenv import load_dotenv
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
| 17 |
-
MODEL_NAME = "openai/whisper-large-v3"
|
| 18 |
BATCH_SIZE = 8
|
| 19 |
-
FILE_LIMIT_MB =
|
| 20 |
-
YT_LENGTH_LIMIT_S =
|
| 21 |
|
| 22 |
device = 0 if torch.cuda.is_available() else "cpu"
|
| 23 |
|
| 24 |
pipe = pipeline(
|
| 25 |
task="automatic-speech-recognition",
|
| 26 |
model=MODEL_NAME,
|
| 27 |
-
chunk_length_s=30,
|
| 28 |
device=device,
|
|
|
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
|
|
@@ -110,9 +111,7 @@ mf_transcribe = gr.Interface(
|
|
| 110 |
outputs=[gr.Textbox(label="Transcription"), gr.Textbox(label="Summary")],
|
| 111 |
title="Whisper Large V3: Microphone",
|
| 112 |
description=(
|
| 113 |
-
"Transcribe long-form microphone or audio inputs
|
| 114 |
-
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
| 115 |
-
" of arbitrary length."
|
| 116 |
),
|
| 117 |
allow_flagging="never",
|
| 118 |
)
|
|
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
| 17 |
+
MODEL_NAME = "openai/whisper-large-v3-turbo"
|
| 18 |
BATCH_SIZE = 8
|
| 19 |
+
FILE_LIMIT_MB = 5000 # 5GB
|
| 20 |
+
YT_LENGTH_LIMIT_S = 7200 # 2 hours
|
| 21 |
|
| 22 |
device = 0 if torch.cuda.is_available() else "cpu"
|
| 23 |
|
| 24 |
pipe = pipeline(
|
| 25 |
task="automatic-speech-recognition",
|
| 26 |
model=MODEL_NAME,
|
|
|
|
| 27 |
device=device,
|
| 28 |
+
ignore_warning=True,
|
| 29 |
+
model_kwargs={"torch_dtype": torch.float16} if torch.cuda.is_available() else {}
|
| 30 |
)
|
| 31 |
|
| 32 |
|
|
|
|
| 111 |
outputs=[gr.Textbox(label="Transcription"), gr.Textbox(label="Summary")],
|
| 112 |
title="Whisper Large V3: Microphone",
|
| 113 |
description=(
|
| 114 |
+
"Transcribe long-form microphone or audio inputs."
|
|
|
|
|
|
|
| 115 |
),
|
| 116 |
allow_flagging="never",
|
| 117 |
)
|