Skip to content

from_pretrained downloads *.bin and *.safetensors weights if both are present in the repo #1811

Closed
@apolinario

Description

@apolinario

Describe the bug

If both *.bin and *.safetensors weights exist in a repository both are downloaded even thought only the *.safetensors version are used, doubling the disk size & time to download models.

As we load *.safetensors by default, we should only download them.

Reproduction

import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)

Logs

No response

System Info

diffusers==0.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions