add auto-devices when disk is used

This commit is contained in:
oobabooga 2023-01-19 12:11:44 -03:00
parent 759da435e3
commit 5390fc87c8

View File

@ -63,7 +63,7 @@ def load_model(model_name):
t0 = time.time() t0 = time.time()
# Default settings # Default settings
if not (args.cpu or args.auto_devices or args.load_in_8bit or args.max_gpu_memory is not None): if not (args.cpu or args.load_in_8bit or args.auto_devices or args.disk or args.max_gpu_memory is not None):
if Path(f"torch-dumps/{model_name}.pt").exists(): if Path(f"torch-dumps/{model_name}.pt").exists():
print("Loading in .pt format...") print("Loading in .pt format...")
model = torch.load(Path(f"torch-dumps/{model_name}.pt")) model = torch.load(Path(f"torch-dumps/{model_name}.pt"))