add deployment mode. If /switch-model with deploy: true, will disable /switch-model, /exit and other dangerous APIs (state cache APIs, part of midi APIs)

This commit is contained in:
josc146
2023-11-08 23:29:42 +08:00
parent 0594290b92
commit 7235e1067b
5 changed files with 50 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ Args = "args"
Model = "model"
Model_Status = "model_status"
Model_Config = "model_config"
Deploy_Mode = "deploy_mode"
class ModelStatus(Enum):
@@ -16,6 +17,7 @@ def init():
global GLOBALS
GLOBALS = {}
set(Model_Status, ModelStatus.Offline)
set(Deploy_Mode, False)
def set(key, value):