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

Adapted to the latest version of Transformer (Fixes #13245) #16622

Closed
wants to merge 2 commits into from

Conversation

ledyba
Copy link

@ledyba ledyba commented Nov 2, 2024

Description

This fixes #13245, there is a patch but not reported.

See also the calling function (First argument can not be None any more):
https://github.com/huggingface/transformers/blob/33868a057c02f0368ba63bd1edb746be38fe3d90/src/transformers/modeling_utils.py#L3179-L3440

Checklist:

@ledyba ledyba requested a review from AUTOMATIC1111 as a code owner November 2, 2024 15:50
@ledyba ledyba changed the base branch from master to dev November 2, 2024 15:53
@w-e-w
Copy link
Collaborator

w-e-w commented Nov 2, 2024

@ledyba ledyba closed this Nov 2, 2024
@ledyba
Copy link
Author

ledyba commented Nov 2, 2024

OK.

@ledyba ledyba deleted the fix/13245 branch November 2, 2024 16:17
@w-e-w
Copy link
Collaborator

w-e-w commented Nov 2, 2024

also

See also the calling function (First argument can not be None any more):
https://github.com/huggingface/transformers/blob/33868a057c02f0368ba63bd1edb746be38fe3d90/src/transformers/modeling_utils.py#L3179-L3440

the transformers code you link is 4.47.0.dev0

but we are using transformers==4.30.2

so you shoud be looking at
https://github.com/huggingface/transformers/blob/66fd3a8d626a32989f4569260db32785c6cbf42a/src/transformers/modeling_utils.py#L1955-L1956

but regardless of 4.47.0.dev0 or 4.30.2 docstring says both says

        Parameters:
            pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):
                    ......
                    - `None` if you are both providing the configuration and state dictionary (resp. with keyword
                      arguments `config` and `state_dict`).

which contradicts what you said

so you need to provide more information
for example proving that the doc string is incorrect

@ledyba
Copy link
Author

ledyba commented Nov 2, 2024

Thanks!

but regardless of 4.47.0.dev0 or 4.30.2 docstring says both says

You are right, sorry.
However, I think this is a bug of transformers, because at least 3 people including me reported this patch works.
So, anyway, I think this is not a bug of this web UI. So let me close this issue.
(Of course, there is a possibility that it is a problem that only occurs when you combine them.)

@w-e-w
Copy link
Collaborator

w-e-w commented Nov 2, 2024

because at least 3 people including me reported this patch works.

but the thing is it's working without it for most people it's like what's happening on your system that is cause the issue

like Auto said in the other PR

closing because I can't reproduce the problem; reopen if there's more

so if you can actually figure out what is causing the bug and provide a fix reason for it then sure

@ledyba
Copy link
Author

ledyba commented Nov 3, 2024

Ok, you're right. I'll reopen it if I can find the root cause. Thank you!

@Theliel
Copy link

Theliel commented Nov 11, 2024

Interesting, because the fix actually works. Not only does it allow us to use an updated working version of transformers, it also finally allows us to use an updated version of tokenizers, and thus make Automatic1111 compatible with Python 3.12 (only with some others package updates). I've been testing the environment for days now, and haven't found a single bug for now

Win11, Python 3.12.7, pyTorch 2.5.1 + cu12.4 + cudnn 9.5.1, xformers 0.0.28.post3

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.

[Bug]: impossible to change models
3 participants