Update cloning/clonevoice.py
#14
by
ryusei78
- opened
- cloning/clonevoice.py +8 -0
cloning/clonevoice.py
CHANGED
@@ -3,7 +3,15 @@ from encodec.utils import convert_audio
|
|
3 |
from bark.hubert.hubert_manager import HuBERTManager
|
4 |
from bark.hubert.pre_kmeans_hubert import CustomHubert
|
5 |
from bark.hubert.customtokenizer import CustomTokenizer
|
|
|
|
|
|
|
|
|
|
|
6 |
|
|
|
|
|
|
|
7 |
import torchaudio
|
8 |
import torch
|
9 |
import os
|
|
|
3 |
from bark.hubert.hubert_manager import HuBERTManager
|
4 |
from bark.hubert.pre_kmeans_hubert import CustomHubert
|
5 |
from bark.hubert.customtokenizer import CustomTokenizer
|
6 |
+
import torch
|
7 |
+
|
8 |
+
# Charge le modèle sur le CPU
|
9 |
+
model = torch.load('chemin_vers_ton_modele.pth', map_location=torch.device('cpu'))
|
10 |
+
model = model.eval()
|
11 |
|
12 |
+
# Si vous avez besoin de déplacer le modèle vers un dispositif spécifique après le chargement
|
13 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
14 |
+
model = model.to(device)
|
15 |
import torchaudio
|
16 |
import torch
|
17 |
import os
|