Skip to content

Provide a way to find out which model branches map to which pipelines #2651

@antoche

Description

@antoche

Right now a model repo may have multiple branches (e.g., main, fp16, bf16, etc).

There seems to be a de facto convention that a given branch is designed for a specific purpose. E.g., The "main" branch contains the model weights with fp32 precision for a pytorch model, whereas the fp16 contains the same weights in fp16 precision.

Thus, if I see a "bf16" branch, I would be led to believe that I can get bf16-precision weights for my pytorch model for this branch. But if I try this, I get an error:

OSError: Error no file named diffusion_pytorch_model.bin found in directory .../datasets/huggingface/diffusers/models--stabilityai--stable-diffusion-2-1/snapshots/8d0c902020b6347a7f6d10420bb5e1bf57ff129e/unet.

And looking closer at the files in that branch, it is evident that they are actually destined for a flax model and nothing else. I should have used a FlaxStableDiffusionPipeline instead of a StableDiffusionPipeline. But I could not have known that before trying to instantiate the pipeline.

This seems to be yet another unstated convention, and there is no way of knowing what model&revision will work with what pipeline class other than brute-force trying every combination.

It would be great to have a way of figuring out what each branch is designed for, either via an explicit rule or an API call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions