Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,10 +3,12 @@ from transformers import pipeline
|
|
| 3 |
import os
|
| 4 |
import zipfile
|
| 5 |
import tempfile
|
|
|
|
| 6 |
|
| 7 |
# Initialize the Whisper pipeline
|
| 8 |
model = pipeline("automatic-speech-recognition", model="distil-whisper/distil-large-v3", tokenizer="distil-whisper/distil-large-v3")
|
| 9 |
|
|
|
|
| 10 |
def transcribe_audio(zip_file):
|
| 11 |
# Create a temporary directory to extract the ZIP file
|
| 12 |
with tempfile.TemporaryDirectory() as temp_dir:
|
|
|
|
| 3 |
import os
|
| 4 |
import zipfile
|
| 5 |
import tempfile
|
| 6 |
+
import spaces
|
| 7 |
|
| 8 |
# Initialize the Whisper pipeline
|
| 9 |
model = pipeline("automatic-speech-recognition", model="distil-whisper/distil-large-v3", tokenizer="distil-whisper/distil-large-v3")
|
| 10 |
|
| 11 |
+
@spaces.GPU
|
| 12 |
def transcribe_audio(zip_file):
|
| 13 |
# Create a temporary directory to extract the ZIP file
|
| 14 |
with tempfile.TemporaryDirectory() as temp_dir:
|