Spaces:
Sleeping
Sleeping
update api
Browse files
api.py
CHANGED
|
@@ -11,7 +11,7 @@ from modules import models
|
|
| 11 |
from uuid import uuid4
|
| 12 |
import requests
|
| 13 |
from modules.core import preload
|
| 14 |
-
|
| 15 |
|
| 16 |
app = FastAPI()
|
| 17 |
|
|
@@ -114,9 +114,9 @@ async def tts_api(req: TTSRequest):
|
|
| 114 |
|
| 115 |
# 2. Voice Conversion
|
| 116 |
try:
|
| 117 |
-
models.load_model(ckpt_path)
|
| 118 |
-
vc = models.vc_model
|
| 119 |
-
|
| 120 |
|
| 121 |
if vc is None:
|
| 122 |
raise Exception("Failed to load model")
|
|
@@ -129,8 +129,8 @@ async def tts_api(req: TTSRequest):
|
|
| 129 |
embedding_output_layer="auto", # auto detect layer
|
| 130 |
f0_up_key=req.f0_up_key, # pitch shift
|
| 131 |
f0_file="", # f0 curve file (kosong)
|
| 132 |
-
f0_method="pm", # f0 method
|
| 133 |
-
|
| 134 |
auto_load_index=True, # auto load index
|
| 135 |
faiss_index_file=index_path, # index file path
|
| 136 |
index_rate=index_rate, # index rate
|
|
|
|
| 11 |
from uuid import uuid4
|
| 12 |
import requests
|
| 13 |
from modules.core import preload
|
| 14 |
+
from modules.models import load_model
|
| 15 |
|
| 16 |
app = FastAPI()
|
| 17 |
|
|
|
|
| 114 |
|
| 115 |
# 2. Voice Conversion
|
| 116 |
try:
|
| 117 |
+
# models.load_model(ckpt_path)
|
| 118 |
+
# vc = models.vc_model
|
| 119 |
+
vc = load_model(ckpt_path, config_json="configs/48k-768.json")
|
| 120 |
|
| 121 |
if vc is None:
|
| 122 |
raise Exception("Failed to load model")
|
|
|
|
| 129 |
embedding_output_layer="auto", # auto detect layer
|
| 130 |
f0_up_key=req.f0_up_key, # pitch shift
|
| 131 |
f0_file="", # f0 curve file (kosong)
|
| 132 |
+
# f0_method="pm", # f0 method
|
| 133 |
+
f0_method="harvest", # f0 method
|
| 134 |
auto_load_index=True, # auto load index
|
| 135 |
faiss_index_file=index_path, # index file path
|
| 136 |
index_rate=index_rate, # index rate
|