backend api

This commit is contained in:
josc146
2023-05-07 17:27:54 +08:00
parent 4795514e8f
commit 0e852daf43
8 changed files with 188 additions and 102 deletions

View File

@@ -0,0 +1,27 @@
from enum import Enum, auto
Model = 'model'
Model_Status = 'model_status'
class ModelStatus(Enum):
Offline = auto()
Loading = auto()
Working = auto()
def init():
global GLOBALS
GLOBALS = {}
set(Model_Status, ModelStatus.Offline)
def set(key, value):
GLOBALS[key] = value
def get(key):
if key in GLOBALS:
return GLOBALS[key]
else:
return None