mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 00:33:57 +03:00
improve message
This commit is contained in:
parent
3acdebfa37
commit
c1b75826fa
@ -1,4 +1,5 @@
|
|||||||
import sys, os, argparse
|
import sys, os, argparse
|
||||||
|
import socket
|
||||||
import misc.log_control
|
import misc.log_control
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@ -79,10 +80,10 @@ app_socketio = MMVC_SocketIOApp.get_instance(app_fastapi, voiceChangerManager)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__mp_main__':
|
if __name__ == '__mp_main__':
|
||||||
printMessage(f"PHASE2:{__name__}", level=2)
|
printMessage(f"サーバプロセスを起動しています。", level=2)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
printMessage(f"PHASE1:{__name__}", level=2)
|
printMessage(f"Voice Changerを起動しています。", level=2)
|
||||||
TYPE = args.t
|
TYPE = args.t
|
||||||
PORT = args.p
|
PORT = args.p
|
||||||
CONFIG = args.c
|
CONFIG = args.c
|
||||||
@ -92,7 +93,8 @@ if __name__ == '__main__':
|
|||||||
print("Type(-t) should be MMVC or TRAIN")
|
print("Type(-t) should be MMVC or TRAIN")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
printMessage(f"Start MMVC SocketIO Server", level=0)
|
# printMessage(f"Start MMVC SocketIO Server", level=0)
|
||||||
|
printMessage(f"-- 設定 -- ", level=1)
|
||||||
printMessage(f"CONFIG:{CONFIG}, MODEL:{MODEL} ONNX_MODEL:{ONNX_MODEL}", level=1)
|
printMessage(f"CONFIG:{CONFIG}, MODEL:{MODEL} ONNX_MODEL:{ONNX_MODEL}", level=1)
|
||||||
|
|
||||||
if args.colab == False:
|
if args.colab == False:
|
||||||
@ -136,27 +138,42 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
# HTTP
|
# HTTP
|
||||||
printMessage(f"protocol: HTTP", level=1)
|
printMessage(f"protocol: HTTP", level=1)
|
||||||
|
printMessage(f"-- ---- -- ", level=1)
|
||||||
|
|
||||||
|
|
||||||
# アドレス表示
|
# アドレス表示
|
||||||
|
printMessage(
|
||||||
|
f"ブラウザで次のURLを開いてください.", level=2)
|
||||||
if args.https == 1:
|
if args.https == 1:
|
||||||
printMessage(
|
printMessage(
|
||||||
f"open https://<IP>:<PORT>/ with your browser.", level=0)
|
f"https://<IP>:<PORT>/", level=1)
|
||||||
else:
|
else:
|
||||||
printMessage(
|
printMessage(
|
||||||
f"open http://<IP>:<PORT>/ with your browser.", level=0)
|
f"http://<IP>:<PORT>/", level=1)
|
||||||
|
|
||||||
if TYPE == "MMVC":
|
if TYPE == "MMVC":
|
||||||
path = ""
|
path = ""
|
||||||
else:
|
else:
|
||||||
path = "trainer"
|
path = "trainer"
|
||||||
if "EX_PORT" in locals() and "EX_IP" in locals() and args.https == 1:
|
|
||||||
printMessage(f"In many cases it is one of the following", level=1)
|
printMessage(f"多くの場合は次のいずれかのURLにアクセスすると起動します。", level=2)
|
||||||
printMessage(f"https://localhost:{EX_PORT}/{path}", level=1)
|
if "EX_PORT" in locals() and "EX_IP" in locals(): # シェルスクリプト経由起動(docker)
|
||||||
for ip in EX_IP.strip().split(" "):
|
if args.https == 1:
|
||||||
printMessage(f"https://{ip}:{EX_PORT}/{path}", level=1)
|
printMessage(f"https://localhost:{EX_PORT}/{path}", level=1)
|
||||||
elif "EX_PORT" in locals() and "EX_IP" in locals() and args.https == 0:
|
for ip in EX_IP.strip().split(" "):
|
||||||
printMessage(f"In many cases it is one of the following", level=1)
|
printMessage(f"https://{ip}:{EX_PORT}/{path}", level=1)
|
||||||
printMessage(f"http://localhost:{EX_PORT}/{path}", level=1)
|
else:
|
||||||
|
printMessage(f"http://localhost:{EX_PORT}/{path}", level=1)
|
||||||
|
else: # 直接python起動
|
||||||
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
s.connect(("8.8.8.8", 80))
|
||||||
|
hostname = s.getsockname()[0]
|
||||||
|
if args.https == 1:
|
||||||
|
printMessage(f"https://localhost:{PORT}/{path}", level=1)
|
||||||
|
printMessage(f"https://{hostname}:{PORT}/{path}", level=1)
|
||||||
|
else:
|
||||||
|
printMessage(f"http://localhost:{PORT}/{path}", level=1)
|
||||||
|
printMessage(f"http://{hostname}:{PORT}/{path}", level=1)
|
||||||
|
|
||||||
# サーバ起動
|
# サーバ起動
|
||||||
if args.https:
|
if args.https:
|
||||||
|
Loading…
Reference in New Issue
Block a user