detect status
This commit is contained in:
@@ -6,9 +6,9 @@ Model_Config = "model_config"
|
||||
|
||||
|
||||
class ModelStatus(Enum):
|
||||
Offline = auto()
|
||||
Loading = auto()
|
||||
Working = auto()
|
||||
Offline = 0
|
||||
Loading = 2
|
||||
Working = 3
|
||||
|
||||
|
||||
def init():
|
||||
|
||||
@@ -59,3 +59,8 @@ def update_config(body: ModelConfigBody):
|
||||
global_var.set(global_var.Model_Config, body)
|
||||
|
||||
return "success"
|
||||
|
||||
|
||||
@router.get("/status")
|
||||
def status():
|
||||
return {"status": global_var.get(global_var.Model_Status)}
|
||||
|
||||
Reference in New Issue
Block a user