Upload inference.py
Browse files175 unmodified lines176177178179180181182183175 unmodified linestune=False)# Load fine-tuned checkpointcheckpoint = torch.load(str(self.model_path), map_location=self.device)self.model.load_state_dict(checkpoint['model'])self.model.to(self.device)self.model.eval()175 unmodified lines176177178179180181182183184185186175 unmodified linestune=False)# Load fine-tuned checkpoint. torch 2.6+ flips weights_only to True;# this trusted checkpoint pickles a numpy scalar, keep the full load.checkpoint = torch.load(str(self.model_path), map_location=self.device, weights_only=False)self.model.load_state_dict(checkpoint['model'])self.model.to(self.device)self.model.eval()
inference.py+5-2