Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,14 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
| 18 |
import torch
|
| 19 |
from datasets import load_dataset, Dataset, DatasetDict
|
| 20 |
import spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Constants
|
| 23 |
MODEL_NAME = "openai/whisper-large-v3-turbo"
|
|
@@ -56,7 +64,7 @@ pipe = pipeline(
|
|
| 56 |
model=model,
|
| 57 |
tokenizer=tokenizer,
|
| 58 |
feature_extractor=feature_extractor,
|
| 59 |
-
chunk_length_s=
|
| 60 |
)
|
| 61 |
|
| 62 |
def reset_and_update_dataset(new_data):
|
|
|
|
| 18 |
import torch
|
| 19 |
from datasets import load_dataset, Dataset, DatasetDict
|
| 20 |
import spaces
|
| 21 |
+
import subprocess
|
| 22 |
+
|
| 23 |
+
# Install Flash Attention if possible
|
| 24 |
+
subprocess.run(
|
| 25 |
+
"pip install flash-attn --no-build-isolation",
|
| 26 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
| 27 |
+
shell=True,
|
| 28 |
+
)
|
| 29 |
|
| 30 |
# Constants
|
| 31 |
MODEL_NAME = "openai/whisper-large-v3-turbo"
|
|
|
|
| 64 |
model=model,
|
| 65 |
tokenizer=tokenizer,
|
| 66 |
feature_extractor=feature_extractor,
|
| 67 |
+
chunk_length_s=900, # Increased to 15 minutes
|
| 68 |
)
|
| 69 |
|
| 70 |
def reset_and_update_dataset(new_data):
|