This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Scalar Preference Optimization.""" | |
import torch | |
from torch.nn import functional as F | |
def logp_completion(logits, tokens, mask): | |
"""Compute the log probabilities of completions given their prompts. | |
Args: |