Skip to content

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

We recently fully deprecated (#6886) torch_dtype and torch_device when using to(). But we still have torch_dtype in from_pretrained(). This is a point of confusion for our users. This PR, hence, starts a depcrecation cycle for torch_dtype from from_pretrained().

@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.

@patrickvonplaten
Copy link
Contributor

Generally I like this change, but IMO we should make sure that we're aligned with Transformers here and this is currently not the case: https://github.com/huggingface/transformers/blob/de11e654c962d5b23eb53a4387cd637b01987491/src/transformers/configuration_utils.py#L273

Also see: https://huggingface.slack.com/archives/C01N44FJDHT/p1701688646192709 (I've never really followed up here)

@sayakpaul
Copy link
Member Author

Agree that both the libraries should have similar modeling behaviour. However, this particular case could lead to a confusing developer experience IMO. In one place, we have dtype (to()) and in another (from_pretrained()) we have torch_dtype.

@sayakpaul sayakpaul closed this Feb 10, 2024
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.

4 participants