diff --git a/server/restapi/MMVC_Rest_Fileuploader.py b/server/restapi/MMVC_Rest_Fileuploader.py index 8b44253a..1dfa9c01 100644 --- a/server/restapi/MMVC_Rest_Fileuploader.py +++ b/server/restapi/MMVC_Rest_Fileuploader.py @@ -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) diff --git a/server/voice_changer/ModelSlotManager.py b/server/voice_changer/ModelSlotManager.py index 14dd075d..437a8ae4 100644 --- a/server/voice_changer/ModelSlotManager.py +++ b/server/voice_changer/ModelSlotManager.py @@ -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 diff --git a/server/voice_changer/VoiceChanger.py b/server/voice_changer/VoiceChanger.py index b9c83c71..8924bf43 100755 --- a/server/voice_changer/VoiceChanger.py +++ b/server/voice_changer/VoiceChanger.py @@ -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): # 初期化