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()
# 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():
print("Loading in .pt format...")
model = torch.load(Path(f"torch-dumps/{model_name}.pt"))