CoolFace
Modelpublic

leolee99/PIGuard

sourceHugging Facemitupdated 1y agoView on Hugging Face
13likes57kdownloads
save_model.py12 linesDownload Raw Back to root
1import torch2# from safetensors.torch import load_file3from PIGuard.modeling_piguard import PIGuard, PIGuardConfig4config = PIGuardConfig.from_pretrained("microsoft/deberta-v3-base")5config.num_labels = 26 7model = PIGuard(config)8 9state_dict = torch.load("/home/hao/epoch_1_600_model.pth")10# state_dict = load_file("model.safetensors")11#model.load_state_dict(state_dict, strict=False)12model.save_pretrained("saves")