From dd89041f72030bcfbbcf01e1121ed43097ace1fd Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 11 Mar 2024 18:55:37 +0800 Subject: [PATCH] dep_check.py now ignores GPUtil --- backend-python/dep_check.py | 1 - backend-python/routes/config.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend-python/dep_check.py b/backend-python/dep_check.py index 9abf783..b451d1c 100644 --- a/backend-python/dep_check.py +++ b/backend-python/dep_check.py @@ -7,7 +7,6 @@ import lm_dataformat import ftfy import tqdm import tiktoken -import GPUtil import torch import rwkv diff --git a/backend-python/routes/config.py b/backend-python/routes/config.py index aa0ab1f..b71d30c 100644 --- a/backend-python/routes/config.py +++ b/backend-python/routes/config.py @@ -127,9 +127,12 @@ def update_config(body: ModelConfigBody): @router.get("/status", tags=["Configs"]) def status(): - import GPUtil + try: + import GPUtil - gpus = GPUtil.getGPUs() + gpus = GPUtil.getGPUs() + except: + gpus = [] if len(gpus) == 0: device_name = "CPU" else: