Skip to content

Commit

Permalink
fix os name check
Browse files Browse the repository at this point in the history
  • Loading branch information
CSY-ModelCloud committed Dec 4, 2024
1 parent 15d5624 commit a6636b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions device_smi/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, cls):
command_result = re.sub(r'\n+', '\n', command_result)
result = command_result.split("\n")[1].split(",")
mem_total = int(result[1])
elif os.name == 'darwin':
elif platform.system().lower() == 'darwin':
model = (_run(["sysctl", "-n", "machdep.cpu.brand_string"]).replace("Apple", "").strip())
try:
vendor = (_run(["sysctl", "-n", "machdep.cpu.vendor"]))
Expand Down Expand Up @@ -60,8 +60,6 @@ def __init__(self, cls):
flags.update(line.strip().split(":")[1].split())
if line.startswith("model name"):
model = line.split(":")[1].strip()


elif line.startswith("vendor_id"):
vendor = line.split(":")[1].strip()
except FileNotFoundError:
Expand Down

0 comments on commit a6636b4

Please sign in to comment.