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 json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
@ -42,7 +43,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(res)
|
json_compatible_item_data = jsonable_encoder(res)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
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(...)):
|
def post_concat_uploaded_file(self, filename: str = Form(...), filenameChunkNum: int = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -50,7 +51,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(res)
|
json_compatible_item_data = jsonable_encoder(res)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def get_info(self):
|
def get_info(self):
|
||||||
try:
|
try:
|
||||||
@ -58,7 +59,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def get_performance(self):
|
def get_performance(self):
|
||||||
try:
|
try:
|
||||||
@ -66,7 +67,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
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(...)):
|
def post_update_settings(self, key: str = Form(...), val: Union[int, str, float] = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -75,7 +76,8 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
print(sys.exc_info()[2].tb_lineno)
|
||||||
|
|
||||||
def post_load_model(
|
def post_load_model(
|
||||||
self,
|
self,
|
||||||
@ -105,7 +107,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def post_model_type(self, modelType: ModelType = Form(...)):
|
def post_model_type(self, modelType: ModelType = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -113,7 +115,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def get_model_type(self):
|
def get_model_type(self):
|
||||||
try:
|
try:
|
||||||
@ -121,7 +123,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def get_onnx(self):
|
def get_onnx(self):
|
||||||
try:
|
try:
|
||||||
@ -129,7 +131,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def post_merge_models(self, request: str = Form(...)):
|
def post_merge_models(self, request: str = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -138,7 +140,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def post_update_model_default(self):
|
def post_update_model_default(self):
|
||||||
try:
|
try:
|
||||||
@ -146,7 +148,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def post_update_model_info(self, newData: str = Form(...)):
|
def post_update_model_info(self, newData: str = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -154,7 +156,7 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
|
||||||
def post_upload_model_assets(self, params: str = Form(...)):
|
def post_upload_model_assets(self, params: str = Form(...)):
|
||||||
try:
|
try:
|
||||||
@ -162,4 +164,4 @@ class MMVC_Rest_Fileuploader:
|
|||||||
json_compatible_item_data = jsonable_encoder(info)
|
json_compatible_item_data = jsonable_encoder(info)
|
||||||
return JSONResponse(content=json_compatible_item_data)
|
return JSONResponse(content=json_compatible_item_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[Voice Changer] ", e)
|
print("[Voice Changer] ex:", e)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from const import UPLOAD_DIR
|
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
|
from voice_changer.utils.VoiceChangerParams import VoiceChangerParams
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
from typing import Any, Union, cast
|
from typing import Any, Union, cast
|
||||||
|
|
||||||
import socketio
|
|
||||||
from const import TMP_DIR, ModelType
|
from const import TMP_DIR, ModelType
|
||||||
import torch
|
import torch
|
||||||
import os
|
import os
|
||||||
@ -61,12 +60,7 @@ class VoiceChangerSettings:
|
|||||||
|
|
||||||
class VoiceChanger:
|
class VoiceChanger:
|
||||||
ioRecorder: IORecorder
|
ioRecorder: IORecorder
|
||||||
sola_buffer: AudioInOut
|
# sola_buffer: AudioInOut
|
||||||
namespace: socketio.AsyncNamespace | None = None
|
|
||||||
|
|
||||||
localPerformanceShowTime = 0.0
|
|
||||||
|
|
||||||
emitTo = None
|
|
||||||
|
|
||||||
def __init__(self, params: VoiceChangerParams):
|
def __init__(self, params: VoiceChangerParams):
|
||||||
# 初期化
|
# 初期化
|
||||||
|
Loading…
Reference in New Issue
Block a user