Spaces:
Running
Running
Commit ·
6d1fbad
1
Parent(s): 3e9dbbe
Update path
Browse filesFiles changed (2)
2 unmodified lines345678105 unmodified lines1141151161171182 unmodified linesimport loggingimport natsortimport globlogger = logging.getLogger(__name__)105 unmodified lineslogger.info("Loading checkpoint %s", checkpoint_path)device = None if torch.cuda.is_available() else torch.device('cpu')checkpoint = torch.load(checkpoint_path, map_location=device, weights_only=False)self.model.load_state_dict(checkpoint["model"])2 unmodified lines3456789105 unmodified lines1151161171181191201211221231241252 unmodified linesimport loggingimport natsortimport globfrom huggingface_hub import hf_hub_download, snapshot_downloadlogger = logging.getLogger(__name__)105 unmodified lineslogger.info("Loading checkpoint %s", checkpoint_path)device = None if torch.cuda.is_available() else torch.device('cpu')# checkpoint = torch.load(checkpoint_path, map_location=device, weights_only=False)repo_path = snapshot_download(repo_id="SinaLab/Nested")model_file = os.path.join(repo_path, "checkpoints", "checkpoint_2.pt")checkpoint = torch.load(model_file, map_location=device, weights_only=False)self.model.load_state_dict(checkpoint["model"])
27 unmodified lines28293031323327 unmodified lines# filename="checkpoints/checkpoint_2.pt"# )checkpoint_path = snapshot_download(repo_id="SinaLab/Nested", allow_patterns="checkpoints/")print("checkpoint_path : ", checkpoint_path)27 unmodified lines282930313233343527 unmodified lines# filename="checkpoints/checkpoint_2.pt"# )checkpoint_path = snapshot_download(repo_id="SinaLab/Nested", allow_patterns="checkpoints/")print("checkpoint_path : ", checkpoint_path)
Nested/trainers/BaseTrainer.py+8-1
app.py+2