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

Reintroduce SetFitModel.to #236

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

tomaarsen
Copy link
Member

Hello!

Pull Request Overview

Details

The merge commit implementing #229 had to be reversed due to test failures. However, the test failures were caused by another issue, described in #235. The changes from this PR should be safe. As a result, it was requested to reintroduce these changes.

Apologies for the mess surrounding the test failures.

  • Tom Aarsen

* Add SetFitModel.to

* Add docstring for 'to' to clarify that we don't copy

Note that this does mean that we differ from e.g. torch, which creates a moved copy rather than moving the e.g. tensor itself to a different device.

* Add tests for 'to'.

If CUDA is available, then try to move a model from the CPU to the GPU and back to the CPU.

* Reformat test_modeling

Co-authored-by: Tom Aarsen <Cubiegamedev@gmail.com>
Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks for re-opening the PR @tomaarsen and apologies to @jegork for thinking it was your PR that caused the CI to break.

This looks great, so merging now - thanks again @jegork !

@lewtun lewtun merged commit 7e2ae63 into huggingface:main Dec 15, 2022
@tomaarsen tomaarsen deleted the enhancement/reintroduce_to branch December 15, 2022 11:09
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