improve python backend startup speed
This commit is contained in:
parent
dbb8374d89
commit
719090cc8c
@ -6,7 +6,6 @@ from pydantic import BaseModel
|
||||
from utils.rwkv import *
|
||||
from utils.torch import *
|
||||
import global_var
|
||||
import GPUtil
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@ -112,6 +111,8 @@ def update_config(body: ModelConfigBody):
|
||||
|
||||
@router.get("/status", tags=["Configs"])
|
||||
def status():
|
||||
import GPUtil
|
||||
|
||||
gpus = GPUtil.getGPUs()
|
||||
if len(gpus) == 0:
|
||||
device_name = "CPU"
|
||||
|
Loading…
Reference in New Issue
Block a user