Skip to content

Enable thinking models #1627

@rlouf

Description

@rlouf

A v0 would be allowing users to instantiate the logits processor ThinkingLogitsProcessor with the end of thinking token and pass it to the generator.

model = ...
logits_processor = ThinkingLogitsProcessor("</think>", output_type)
generator = Generator(model, processor=logits_processor)

The implementation is simple:

  1. While </think> has not been observed, __call__ is a pass-through.
  2. After <think> has been generated, mask the logits to generate the type passed by the user.

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