Upload code/train_sft.py with huggingface_hub
Browse files309 unmodified lines310311312313314315316317309 unmodified linestok_slice = self.tokens_mmap[start_idx:end_idx]lbl_slice = self.labels_mmap[start_idx:end_idx]tokens = torch.from_numpy(tok_slice).to(torch.long)labels = torch.from_numpy(lbl_slice).to(torch.long)# Fast C-level label restoration for int16 overflowed tokensmask = (labels < 0) & (labels != -100)if mask.any():309 unmodified lines310311312313314315316317309 unmodified linestok_slice = self.tokens_mmap[start_idx:end_idx]lbl_slice = self.labels_mmap[start_idx:end_idx]tokens = torch.from_numpy(tok_slice.copy()).to(torch.long)labels = torch.from_numpy(lbl_slice.copy()).to(torch.long)# Fast C-level label restoration for int16 overflowed tokensmask = (labels < 0) & (labels != -100)if mask.any():
code/train_sft.py+2-2