2023-01-14 03:40:08 +03:00
|
|
|
import os, sys
|
2023-01-15 23:22:27 +03:00
|
|
|
import tempfile
|
2023-01-08 11:58:27 +03:00
|
|
|
|
2023-01-14 03:40:08 +03:00
|
|
|
frontend_path = os.path.join(sys._MEIPASS, "dist") if hasattr(sys, "_MEIPASS") else "../client/demo/dist"
|
2023-01-08 11:58:27 +03:00
|
|
|
ERROR_NO_ONNX_SESSION = "ERROR_NO_ONNX_SESSION"
|
|
|
|
|
2023-01-15 23:31:49 +03:00
|
|
|
|
|
|
|
tmpdir = tempfile.TemporaryDirectory()
|
2023-01-16 01:26:24 +03:00
|
|
|
# print("generate tmpdir:::",tmpdir)
|
2023-01-15 23:31:49 +03:00
|
|
|
SSL_KEY_DIR = os.path.join(tmpdir.name, "keys") if hasattr(sys, "_MEIPASS") else "keys"
|
|
|
|
MODEL_DIR = os.path.join(tmpdir.name, "logs") if hasattr(sys, "_MEIPASS") else "logs"
|
|
|
|
UPLOAD_DIR = os.path.join(tmpdir.name, "upload_dir") if hasattr(sys, "_MEIPASS") else "upload_dir"
|
2023-01-15 23:22:27 +03:00
|
|
|
# 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"
|