MCPcopy Create free account
hub / github.com/ckd0817/LLM-Interview-Code / forward

Method forward

loss/SFTLoss.py:27–66  ·  view source on GitHub ↗

前向传播 Args: logits: 模型输出的未归一化对数概率 [batch_size, seq_len, vocab_size] labels: 真实词元索引 [batch_size, seq_len] prompt_lengths: 每个样本的 prompt 长度 [batch_size] Returns: loss: 标量损失值

(self, logits, labels, prompt_lengths)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected