Skip to content

Conversation

@ttio2tech
Copy link
Contributor

What does this PR do?

The input_ids are generated by the tokenizer and should be moved to the correct device before being passed to the text encoder. However, in current code, the tokens are moved to self.device, which, when CPU offloading is enabled, can point to the CPU. Instead, they should be moved to the device variable within that function's scope, which correctly holds the execution device (the GPU).

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thank you!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yiyixuxu yiyixuxu merged commit e1b7f1f into huggingface:main Sep 10, 2025
10 checks passed
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