cigol123 commited on
Commit
15f730f
·
verified ·
1 Parent(s): b55f886

Update download_model.py

Browse files
Files changed (1) hide show
  1. download_model.py +8 -5
download_model.py CHANGED
@@ -2,11 +2,14 @@ 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!")
 
 
 
 
 
2
  import os
3
 
4
  # Ensure the cache directory exists
5
+ cache_dir = "/app/.cache"
6
  os.makedirs(cache_dir, exist_ok=True)
7
 
 
8
  print("Downloading Whisper model and processor...")
9
+ try:
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!")
13
+ except Exception as e:
14
+ print(f"Failed to download model: {e}")
15
+ raise