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

Bug introduced in from_pretrained v4.48.3..v4.49.0 #36258

Open
hlky opened this issue Feb 18, 2025 · 1 comment · May be fixed by #36262
Open

Bug introduced in from_pretrained v4.48.3..v4.49.0 #36258

hlky opened this issue Feb 18, 2025 · 1 comment · May be fixed by #36262
Labels

Comments

@hlky
Copy link
Contributor

hlky commented Feb 18, 2025

Hi 🤗

Diffusers 🧨 noticed some failing tests starting with v4.49.0 in Kolors, one of our models that uses a custom text encoder.

Reproduction

This is working on v4.48.3.

from transformers import AutoModel

model = AutoModel.from_pretrained("hf-internal-testing/tiny-random-chatglm3-6b", trust_remote_code=True)

On v4.49.0:

TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=str, device=str), but expected one of:
 * (tuple of ints size, *, tuple of names names, torch.memory_format memory_format = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False)
 * (tuple of ints size, *, torch.memory_format memory_format = None, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False)

The issue seems to be that the config in the test model and checkpoints like Kwai-Kolors/Kolors-diffusers contain torch_dtype as a string.

On Diffusers end explicitly setting torch_dtype when using ChatGLMModel and setting a default torch_dtype for from_pretrained paths is working huggingface/diffusers#10816 and it's mainly internal effects as torch_dtype wasn't passed for some tests, should be ok for end users as they would generally pass torch_dtype.

@hlky hlky added the bug label Feb 18, 2025
@zucchini-nlp
Copy link
Member

Hey @hlky ! Thanks for reporting that. Seems to have been broken after the recent addition of dtype for composite configs. I will submit a PR to fix it

@zucchini-nlp zucchini-nlp linked a pull request Feb 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants