From 5cf1d47bbd1ede634b681502a5d6f765cce1c428 Mon Sep 17 00:00:00 2001 From: ZeYi Lin <944270057@qq.com> Date: Wed, 21 Aug 2024 16:34:10 +0800 Subject: [PATCH 1/2] fix --- script/build_pypi.py | 2 +- swanlab/data/run/system/info.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/script/build_pypi.py b/script/build_pypi.py index d977b0b7..8da9e38a 100644 --- a/script/build_pypi.py +++ b/script/build_pypi.py @@ -20,7 +20,7 @@ version = os.getenv("VERSION") if not version: raise ValueError("尚未指定构建版本号") -with open("swanlab/package.json", 'r+') as f: +with open("swanlab/package.json", "r+") as f: p = json.load(f) p["version"] = version f.seek(0) diff --git a/swanlab/data/run/system/info.py b/swanlab/data/run/system/info.py index c414f8a4..e29aeb14 100644 --- a/swanlab/data/run/system/info.py +++ b/swanlab/data/run/system/info.py @@ -98,7 +98,11 @@ def __get_nvidia_gpu_info(): try: # 获取 NVIDIA 驱动版本信息 - info["driver"] = pynvml.nvmlSystemGetDriverVersion() + nv_driver = pynvml.nvmlSystemGetDriverVersion() + if isinstance(nv_driver, bytes): + nv_driver = nv_driver.decode("utf-8") + info["driver"] = nv_driver + # 获取 NVIDIA GPU 数量 info["cores"] = pynvml.nvmlDeviceGetCount() # 遍历每个 GPU,获取 GPU 信息 From a39d21d8adeba0dd3fa389174d336af30c1e77e2 Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:42:52 +0800 Subject: [PATCH 2/2] reset --- pyproject.toml | 2 ++ script/build_pypi.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6fc058c8..fc701d79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,3 +109,5 @@ ignore = [] # black配置,与构建无关 [tool.black] line-length = 120 +skip-string-normalization = true + diff --git a/script/build_pypi.py b/script/build_pypi.py index 8da9e38a..d977b0b7 100644 --- a/script/build_pypi.py +++ b/script/build_pypi.py @@ -20,7 +20,7 @@ version = os.getenv("VERSION") if not version: raise ValueError("尚未指定构建版本号") -with open("swanlab/package.json", "r+") as f: +with open("swanlab/package.json", 'r+') as f: p = json.load(f) p["version"] = version f.seek(0)