Fix mamba integration by making it a variant of outlines.models.transformers#32
Draft
lapp0 wants to merge 12 commits into
Draft
Fix mamba integration by making it a variant of outlines.models.transformers#32lapp0 wants to merge 12 commits into
outlines.models.transformers#32lapp0 wants to merge 12 commits into
Conversation
84ea1eb to
99813cf
Compare
3123f3a to
9b513af
Compare
783acf6 to
68ea867
Compare
872b9c6 to
5ce23f7
Compare
32319df to
7d43bbd
Compare
Co-authored-by: Patrice Bechard <bechardpatrice@gmail.com>
…ration) (dottxt-ai#1039) As [discussed in our Discord server](https://discord.com/channels/1182316225284554793/1182317446225481788/1261998326077984802) This PR adds support for custom regex parsers. This doesn't change the behavior of Outlines by default. But this allows us to write custom `Guide` classes that uses custom regex parsers for e.g. multimodal generation. Also improves documentation
f17913b to
48b6f8f
Compare
48b6f8f to
bf3694c
Compare
60449d4 to
75dc370
Compare
75dc370 to
acb0759
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes dottxt-ai#808
Rendered docs: https://github.com/lapp0/outlines/blob/fix-mamba-integration/docs/reference/models/transformers.md#alternative-model-classes
Problem
SequenceGenerator. It should useSequenceGeneratorAdapterand have logits processors manage the automata.models.mambadoesn't work at all inmain.Solution
Update
models.transformersto accept amodel_classargument allowing for additional model types beyondAutoModelForCausalLM. Makemodels.mambasimply a variant ofmodels.transformerswith themodel_class=transformers.MambaForCausalLMpassed. This results in nearly zero maintenance required formodels.mamba.Unrelated work
Additionally Zach on Discord requested T5-based structured generation. I tested it with
model_class=transformers.AutoModelForSeq2SeqLMand it works with zero additional changes. The only change I made related to this is adding amodel_t5fixture to ourtest_generate.pytested models and documenting it indocs/reference/models/transformers.md.