Skip to content

Conversation

mishig25
Copy link
Contributor

@mishig25 mishig25 commented Sep 21, 2022

Moving weights names consts, such as WEIGHTS_NAME, to utils.__init__.py (common file that is not dependent on pt or flax)

WEIGHTS_NAME = "diffusion_pytorch_model.bin"
FLAX_WEIGHTS_NAME = "diffusion_flax_model.msgpack"
ONNX_WEIGHTS_NAME = "model.onnx"

The reason being: currently on main, when modeling_flax_utils import WEIGHTS_NAME, it will throw an error if pytorch is not available in the env

from .modeling_utils import WEIGHTS_NAME, load_state_dict

And transformers is solving the issue by putting the weight name consts into common utils file here

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 21, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

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

Great catch!

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Nice!

@patrickvonplaten patrickvonplaten merged commit 8685699 into main Sep 21, 2022
@patil-suraj patil-suraj deleted the mv_weight_names_utils branch September 21, 2022 09:30
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
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