Fix PyTorch 2.7 compatibility: total_mem → total_memory (v0.2.1)

PyTorch 2.7+ renamed `get_device_properties().total_mem` to
`total_memory`. Fixed in gpu.py and callback.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alpamys 2026-03-04 00:37:07 +05:00
parent cab3c0b0fb
commit 4010798e2b
4 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "soup-cli"
version = "0.2.0"
version = "0.2.1"
description = "Fine-tune LLMs in one command. No SSH, no config hell."
readme = "README.md"
license = "MIT"

View File

@ -1,3 +1,3 @@
"""Soup CLI — Fine-tune LLMs in one command."""
__version__ = "0.2.0"
__version__ = "0.2.1"

View File

@ -47,7 +47,7 @@ class SoupTrainerCallback(TrainerCallback):
if torch.cuda.is_available():
used = torch.cuda.memory_allocated() / (1024**3)
total = torch.cuda.get_device_properties(0).total_mem / (1024**3)
total = torch.cuda.get_device_properties(0).total_memory / (1024**3)
gpu_mem = f"{used:.1f}/{total:.1f} GB"
except Exception:
pass

View File

@ -25,7 +25,7 @@ def get_gpu_info() -> dict:
import torch
if torch.cuda.is_available():
total = torch.cuda.get_device_properties(0).total_mem
total = torch.cuda.get_device_properties(0).total_memory
total_gb = total / (1024**3)
return {
"memory_total": f"{total_gb:.1f} GB",