API: add response with json

This commit is contained in:
Ftps
2024-03-26 23:24:35 +09:00
parent bf8a669c79
commit efed797200
3 changed files with 23 additions and 14 deletions

View File

@@ -36,8 +36,8 @@ class VC:
self.config = Config()
def get_vc(self, sid: str, *to_return_protect: int):
logger.info("Get sid: " + sid)
def get_vc(self, sid: str | Path, *to_return_protect: int):
logger.info("Get sid: " + os.path.basename(sid))
return_protect = [
to_return_protect[0] if self.if_f0 != 0 and to_return_protect else 0.5,

View File

@@ -13,7 +13,7 @@ def get_index_path_from_model(sid):
for name in files
if name.endswith(".index") and "trained" not in name
]
if sid.split(".")[0] in f
if str(sid).split(".")[0] in f
),
"",
)