Wiki source code of Install OpenVoice v2 Locally - Instantly Clone Voice with AI
Version 1.1 by René Schmidt on 2025/03/10 17:37
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
1.1 | 1 | import os |
| 2 | |||
| 3 | import torch | ||
| 4 | |||
| 5 | from openvoice import se_extractor | ||
| 6 | |||
| 7 | from openvoice.api import ToneColorConverter | ||
| 8 | |||
| 9 | ckpt_converter = 'checkpoints_v2/converter' | ||
| 10 | |||
| 11 | device = "cuda:0" if torch.cuda.is_available() else "cpu" | ||
| 12 | |||
| 13 | output_dir = 'outputs_v2' | ||
| 14 | |||
| 15 | tone_color_converter = ToneColorCOnverter(f'{ckpt_converter}/config.json', device=device) |
