cigol123 commited on
Commit
d17a8fc
·
verified ·
1 Parent(s): 2aeb7d4

Create download_model.py

Browse files
Files changed (1) hide show
  1. 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!")