File size: 614 Bytes
18b88bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from faster_whisper import download_model
import shutil
import os

def fetch_and_move(model_name, target_dir):
    print(f"Downloading model: {model_name}...")
    downloaded_path = download_model(model_name)
    
    if os.path.exists(target_dir):
        shutil.rmtree(target_dir)
    
    os.makedirs(os.path.dirname(target_dir), exist_ok=True)
    shutil.copytree(downloaded_path, target_dir)
    print(f"Model {model_name} successfully moved to: {target_dir}")

# Fast model
fetch_and_move("base", "/app/models/fast")

# Accurate model
fetch_and_move("Systran/faster-whisper-large-v3", "/app/models/accurate")