Spaces:
Sleeping
Sleeping
| 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") |