Skip to content

Support returning raw logits in generate #17521

Description

@shijie-wu

Feature request

Support returning raw logits in generate by either:

  1. creating a new arg that enables return of raw logits
  2. or support callback that allow users to collect the raw logits

Motivation

  • Raw logits "would be the most understandable & consistent across generation methods" (@patrickvonplaten)
  • For testing, returning raw logits would help "identify which parts get wrong if any test failure occurs" (@ydshieh)
  • There's concern about "rampant too many options" (@Narsil), thus I would prefer the second option to support this feature.
  • However, the second option still needs code change to support it. As the user provided logits_processor is appended to a new instance of LogitsProcessorList. As a result, users cannot get the raw logits using the current implementation even with a custom LogitsProcessor.

See further discussion in #17424

Your contribution

I could open a PR to reorder how logits_processor is merged with the predefined list of LogitsProcessorList.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions