Skip to content

simplify unsloth_base_fast_generate - #3291

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
mmathew23:gemmainference
Sep 9, 2025
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
mmathew23:gemmainference

Conversation

@mmathew23

Copy link
Copy Markdown
Contributor

hybrid cache's are deprecated in transformers 4.56 so we check for transformers version before setting hybrid.

We also remove prompt_lookup_num_tokens by default and the try except generates and simplify to a single generate call.

Tested notebooks on transformers 4.55.4, 4.56.1, and transformers main branch

4.55.4: https://colab.research.google.com/drive/1e079MnXVxHZ8FFrUQyyt6TrYRWKrqwO4?usp=sharing
4.56.1: https://colab.research.google.com/drive/1cKPrgwUkkGUKuLeTw5d6cpcCSi_bsTXb?usp=sharing
main: https://colab.research.google.com/drive/13fiFh5GcMHhKKZUPox9Z0sRgSYLZ9tTS?usp=sharing

@danielhanchen
danielhanchen merged commit a5968f3 into unslothai:main Sep 9, 2025
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
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.

2 participants