Skip to content

repetiton_penalty and logits_bias just using logits_processors#1004

Merged
awni merged 2 commits intoml-explore:mainfrom
nathanrchn:refactor_repetition_logits_bias_with_logits_processor
Sep 30, 2024
Merged

repetiton_penalty and logits_bias just using logits_processors#1004
awni merged 2 commits intoml-explore:mainfrom
nathanrchn:refactor_repetition_logits_bias_with_logits_processor

Conversation

@nathanrchn
Copy link
Copy Markdown
Contributor

Continuation of #983.
This PR refactors the repetition_penalty and logits_bias logic to utilize the new logits_processor argument. These changes:

  1. Reduce complexity in the generate_step method
  2. Modify the logits_processor type to accept a list of functions, enabling chained processing

These enhancements allow for more flexible and modular logit processing while simplifying the generation code.

Copy link
Copy Markdown
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition!

@chimezie
Copy link
Copy Markdown
Contributor

@nathanrchn & @awni Can DRY sampling be incorporated using this mechanism (I'm interested in creating a PR for it)?

@awni
Copy link
Copy Markdown
Member

awni commented Sep 30, 2024

Yea I think it should work well.

@awni awni merged commit 0866e23 into ml-explore:main Sep 30, 2024
@nathanrchn nathanrchn deleted the refactor_repetition_logits_bias_with_logits_processor branch September 30, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants