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

Refactor the Transformers and TransformersVision model #1430

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

RobinPicard
Copy link
Contributor

@RobinPicard RobinPicard commented Feb 20, 2025

This PR takes over what was started by @rlouf in #1344

The objective is to adapt Transfomers and TransformersVision to the model interface used in v1.0. To do so, we modify the signature of the generate method and make it the only way of generating text with the model. We also modify the handling of model/tokenizer optional arguments to avoid manipulating them ourselves (giving to the user the responsibility of choosing those they need).

I deleted the tests for those models from tests/generate and instead put the tests in the tests/models.

I also included a commit that fixes some issues on the current version of branch v1.0 that are unrelated to this PR but were preventing me from running the tests.

@RobinPicard RobinPicard added this to the 1.0 milestone Feb 20, 2025
@RobinPicard RobinPicard self-assigned this Feb 20, 2025
@RobinPicard RobinPicard added enhancement transformers Linked to the `transformers` integration labels Feb 20, 2025
@RobinPicard RobinPicard removed the request for review from yvan-sraka February 20, 2025 10:59
@RobinPicard RobinPicard force-pushed the refactor-transformers branch from 231dd51 to f764a66 Compare February 20, 2025 22:00
@RobinPicard RobinPicard force-pushed the refactor-transformers branch from f764a66 to ff6366c Compare February 20, 2025 23:30
@rlouf rlouf linked an issue Feb 21, 2025 that may be closed by this pull request
@rlouf
Copy link
Member

rlouf commented Feb 21, 2025

You can merge after addressing my comment and once that test is fixed.

@RobinPicard RobinPicard force-pushed the refactor-transformers branch from ff6366c to f6e1882 Compare February 21, 2025 21:13
@RobinPicard RobinPicard merged commit 750b3ed into dottxt-ai:v1.0 Feb 21, 2025
4 of 5 checks passed
rlouf pushed a commit to RobinPicard/outlines that referenced this pull request Feb 24, 2025
The objective of this commit is to adapt `Transfomers` and `TransformersVision` to the
model interface used in v1.0. The main changes are:
- make the models inherit from the base class `Model` and create a
`ModelTypeAdapter` for them
- modify the signature of the `generate` method and make it the only way of
generating text with the model.
- modify the handling of model/tokenizer optional arguments to avoid manipulating
them ourselves (giving to the user the responsibility of choosing those they need).
- delete the tests for those models in the `generate` directory and test them instead
in the `models` directory
rlouf pushed a commit to RobinPicard/outlines that referenced this pull request Feb 24, 2025
The objective of this commit is to adapt `Transfomers` and `TransformersVision` to the
model interface used in v1.0. The main changes are:
- make the models inherit from the base class `Model` and create a
`ModelTypeAdapter` for them
- modify the signature of the `generate` method and make it the only way of
generating text with the model.
- modify the handling of model/tokenizer optional arguments to avoid manipulating
them ourselves (giving to the user the responsibility of choosing those they need).
- delete the tests for those models in the `generate` directory and test them instead
in the `models` directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement transformers Linked to the `transformers` integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the transformers integration
2 participants