Spaces:
Running
Running
Create download_model.py
Browse files- download_model.py +12 -0
download_model.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
2 |
+
import os
|
3 |
+
|
4 |
+
# Ensure the cache directory exists
|
5 |
+
cache_dir = "./.cache"
|
6 |
+
os.makedirs(cache_dir, exist_ok=True)
|
7 |
+
|
8 |
+
# Download the model and processor
|
9 |
+
print("Downloading Whisper model and processor...")
|
10 |
+
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v3", cache_dir=cache_dir)
|
11 |
+
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3", cache_dir=cache_dir)
|
12 |
+
print("✓ Model and processor downloaded successfully!")
|