mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 21:45:00 +03:00
some fixis
This commit is contained in:
parent
bd3d3375c3
commit
4a8851aff1
@ -1,3 +1,4 @@
|
||||
import sys
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
@ -42,7 +43,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(res)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_concat_uploaded_file(self, filename: str = Form(...), filenameChunkNum: int = Form(...)):
|
||||
try:
|
||||
@ -50,7 +51,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(res)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def get_info(self):
|
||||
try:
|
||||
@ -58,7 +59,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def get_performance(self):
|
||||
try:
|
||||
@ -66,7 +67,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_update_settings(self, key: str = Form(...), val: Union[int, str, float] = Form(...)):
|
||||
try:
|
||||
@ -75,7 +76,8 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
print(sys.exc_info()[2].tb_lineno)
|
||||
|
||||
def post_load_model(
|
||||
self,
|
||||
@ -105,7 +107,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_model_type(self, modelType: ModelType = Form(...)):
|
||||
try:
|
||||
@ -113,7 +115,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def get_model_type(self):
|
||||
try:
|
||||
@ -121,7 +123,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def get_onnx(self):
|
||||
try:
|
||||
@ -129,7 +131,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_merge_models(self, request: str = Form(...)):
|
||||
try:
|
||||
@ -138,7 +140,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_update_model_default(self):
|
||||
try:
|
||||
@ -146,7 +148,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_update_model_info(self, newData: str = Form(...)):
|
||||
try:
|
||||
@ -154,7 +156,7 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
||||
def post_upload_model_assets(self, params: str = Form(...)):
|
||||
try:
|
||||
@ -162,4 +164,4 @@ class MMVC_Rest_Fileuploader:
|
||||
json_compatible_item_data = jsonable_encoder(info)
|
||||
return JSONResponse(content=json_compatible_item_data)
|
||||
except Exception as e:
|
||||
print("[Voice Changer] ", e)
|
||||
print("[Voice Changer] ex:", e)
|
||||
|
@ -1,5 +1,5 @@
|
||||
from const import UPLOAD_DIR
|
||||
from data.ModelSlot import ModelSlots, loadAllSlotInfo, loadSlotInfo, saveSlotInfo
|
||||
from data.ModelSlot import ModelSlots, loadAllSlotInfo, saveSlotInfo
|
||||
from voice_changer.utils.VoiceChangerParams import VoiceChangerParams
|
||||
import json
|
||||
import os
|
||||
|
@ -1,6 +1,5 @@
|
||||
from typing import Any, Union, cast
|
||||
|
||||
import socketio
|
||||
from const import TMP_DIR, ModelType
|
||||
import torch
|
||||
import os
|
||||
@ -61,12 +60,7 @@ class VoiceChangerSettings:
|
||||
|
||||
class VoiceChanger:
|
||||
ioRecorder: IORecorder
|
||||
sola_buffer: AudioInOut
|
||||
namespace: socketio.AsyncNamespace | None = None
|
||||
|
||||
localPerformanceShowTime = 0.0
|
||||
|
||||
emitTo = None
|
||||
# sola_buffer: AudioInOut
|
||||
|
||||
def __init__(self, params: VoiceChangerParams):
|
||||
# 初期化
|
||||
|
Loading…
Reference in New Issue
Block a user