Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation refactor: part 2 #1099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Generation refactor: part 2 #1099

wants to merge 2 commits into from

Conversation

awni
Copy link
Member

@awni awni commented Nov 8, 2024

  • Add a generation response data class for stream_generate
  • generate now uses stream_generate
  • Server also uses stats recorded by stream_generate
  • Maybe controversial: I removed the color formatting option. This is broken and there is not a simple fix given that tokens to unicode characters is many-to-many. So we can add it back as a hack which works for most cases or just remove it as I don't think it's used much anymore..

@awni awni changed the title Sampler refactor: part 2 Generation refactor: part 2 Nov 8, 2024
@awni awni requested a review from angeloskath November 8, 2024 03:49
Copy link
Member

@angeloskath angeloskath left a comment

Choose a reason for hiding this comment

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

I like it. This is a backwards incompatible change in more ways than 1 but I think it is a clear improvement. If we do want to add features like colorize these should be implemented in the generate script rather in the generate function.

tokenizer = TokenizerWrapper(tokenizer)

if formatter is not None:
print("Text formatting is deprecated and will be removed in the next version.")
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this makes it clear that it is not used anymore 🤔

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