Create load_models.py
Browse files- load_models.py +13 -0
load_models.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
from pathlib import Path
|
3 |
+
from synthesizer.inference import Synthesizer
|
4 |
+
from encoder import inference as encoder
|
5 |
+
from vocoder import inference as vocoder
|
6 |
+
|
7 |
+
project_name = "Real-Time-Voice-Cloning"
|
8 |
+
sys.path.append(project_name)
|
9 |
+
|
10 |
+
# Load the models
|
11 |
+
encoder.load_model(Path(project_name) / "encoder/saved_models/pretrained.pt")
|
12 |
+
synthesizer = Synthesizer(Path(project_name) / "synthesizer/saved_models/pretrained/pretrained.pt")
|
13 |
+
vocoder.load_model(Path(project_name) / "vocoder/saved_models/pretrained/pretrained.pt")
|