Upload code/model.py with huggingface_hub
Browse files223 unmodified lines224225226227227228229230223 unmodified lines loss = None if targets is not None: V = self.cfg.vocab_size ce_chunk = 512 # tokens per chunk (avoids VRAM spikes during large vocabulary cross-entropy) ce_chunk = 256 # 256 tokens per chunk prevents 1GB+ tensor fragmentation during 64k vocab CE
if shift_labels: # Shifted: predict token[i+1] from hidden[i]code/model.py+1-1