huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
134.08k stars 26.81k forks source link

tracker: move `prepare_inputs_for_generation` into the generation mixin 🧹 #32685

Closed gante closed 1 week ago

gante commented 2 months ago

🧹 This is a tracker regarding the move of prepare_inputs_for_generation into the generation mixin 🧹

Why?

  1. prepare_inputs_for_generation is not part of the core modeling, but rather a utility for generate
  2. it should greatly reduce the need to touch modeling code, on generate changes. Fewer modeling changes -> improved model stability
  3. greatly reduced number of lines of code 🙏

Tracker

Kinda ordered list of tasks:

gante commented 2 months ago

@ydshieh edit the tracker above as soon as you start working on a task, so we don't risk doing redundant work 🤗 (e.g. with the link to a draft PR)

I'll do the same!

ydshieh commented 2 months ago

Thanks