tmp folder

This commit is contained in:
wataru 2023-01-15 01:30:46 +09:00
parent e8de2df14a
commit 3ac71305d0
4 changed files with 12 additions and 11 deletions

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ __pycache__
server/upload_dir/
server/MMVC_Trainer/
server/MMVC_Client/
server/key
server/keys
server/info
server/memo.md

View File

@ -15,7 +15,7 @@ from voice_changer.VoiceChangerManager import VoiceChangerManager
from sio.MMVC_SocketIOApp import MMVC_SocketIOApp
from restapi.MMVC_Rest import MMVC_Rest
from const import SSL_KEY_DIR
def setupArgParser():
parser = argparse.ArgumentParser()
@ -116,7 +116,7 @@ if __name__ == '__main__':
# HTTPS key/cert作成
if args.https and args.httpsSelfSigned == 1:
# HTTPS(おれおれ証明書生成)
os.makedirs("./key", exist_ok=True)
os.makedirs(SSL_KEY_DIR, exist_ok=True)
key_base_name = f"{datetime.now().strftime('%Y%m%d_%H%M%S')}"
keyname = f"{key_base_name}.key"
certname = f"{key_base_name}.cert"
@ -124,9 +124,9 @@ if __name__ == '__main__':
"State": "Tokyo",
"City": "Chuo-ku",
"Organization": "F",
"Org. Unit": "F"}, cert_dir="./key")
key_path = os.path.join("./key", keyname)
cert_path = os.path.join("./key", certname)
"Org. Unit": "F"}, cert_dir=SSL_KEY_DIR)
key_path = os.path.join(SSL_KEY_DIR, keyname)
cert_path = os.path.join(SSL_KEY_DIR, certname)
printMessage(
f"protocol: HTTPS(self-signed), key:{key_path}, cert:{cert_path}", level=1)
elif args.https and args.httpsSelfSigned == 0:

View File

@ -3,4 +3,6 @@ import os, sys
frontend_path = os.path.join(sys._MEIPASS, "dist") if hasattr(sys, "_MEIPASS") else "../client/demo/dist"
ERROR_NO_ONNX_SESSION = "ERROR_NO_ONNX_SESSION"
SSL_KEY_DIR = os.path.join(sys._MEIPASS, "keys") if hasattr(sys, "_MEIPASS") else "keys"
MODEL_DIR = os.path.join(sys._MEIPASS, "logs") if hasattr(sys, "_MEIPASS") else "logs"
UPLOAD_DIR = os.path.join(sys._MEIPASS, "upload_dir") if hasattr(sys, "_MEIPASS") else "upload_dir"

View File

@ -8,10 +8,9 @@ from fastapi import HTTPException, FastAPI, UploadFile, File, Form
from restapi.mods.FileUploader import upload_file, concat_file_chunks
from voice_changer.VoiceChangerManager import VoiceChangerManager
UPLOAD_DIR = "upload_dir"
# os.makedirs(UPLOAD_DIR, exist_ok=True)
MODEL_DIR = "MMVC_Trainer/logs"
# os.makedirs(MODEL_DIR, exist_ok=True)
from const import MODEL_DIR ,UPLOAD_DIR
os.makedirs(UPLOAD_DIR, exist_ok=True)
os.makedirs(MODEL_DIR, exist_ok=True)
class MMVC_Rest_Fileuploader:
def __init__(self, voiceChangerManager:VoiceChangerManager):