Skip to content

Generate: fix candidate device placement#28493

Merged
ArthurZucker merged 2 commits intohuggingface:mainfrom
gante:fix_candidate
Jan 13, 2024
Merged

Generate: fix candidate device placement#28493
ArthurZucker merged 2 commits intohuggingface:mainfrom
gante:fix_candidate

Conversation

@gante
Copy link
Copy Markdown
Contributor

@gante gante commented Jan 13, 2024

What does this PR do?

#27775 was merged, and the branch was not synced with #27995 (already on main) -- the two branches together result in CI failures. Fortunately, the fix is simple :)

@gante gante requested a review from amyeroberts January 13, 2024 17:52
candidate_input_ids, candidate_logits = candidate_generator.get_candidates(
input_ids.to(candidate_generator.assistant_model.device)
)
candidate_input_ids, candidate_logits = candidate_generator.get_candidates(input_ids)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in a nutshell, input_ids should only be moved on some candidate_generator classes -- the move was delegated to the relevant classes

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker 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 taking care of it

@ArthurZucker ArthurZucker merged commit bc72b4e into huggingface:main Jan 13, 2024
@gante gante deleted the fix_candidate branch January 15, 2024 09:30
toddwildey pushed a commit to toddwildey/transformers that referenced this pull request Feb 16, 2024
* fix candidate device

* this line shouldn't have been in
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