huggingface / huggingface/diffusers

AttributeError: 'list' object has no attribute '__module__' when calling from_pretrained using file system

Ouverte
#7,612 7 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@DN6 y travaille déjà.

Depuis le 10/4/2024.

stale
Langage dominant
Python
Étoiles
34.5k
Forks
7.3k
Merge moyen
3 j 3 h
PR mergées (30 j)
91

Description

Discussed in https://github.com/huggingface/diffusers/discussions/7610

Originally posted by dferguson992 April 8, 2024
I downloaded the stabilityai/stable-cascade model from HuggingFace and saved it to my file system using the following:

model = StableCascadeCombinedPipeline.from_pretrained(HF_MODEL_ID, 
                                                      variant="bf16",
                                                      torch_dtype=torch.float16)
model_path = "model/"
code_path = "code/"

if not os.path.exists(model_path):
    os.mkdir(model_path)
if not os.path.exists(code_path):
    os.mkdir(code_path)

model.save_pretrained(save_directory=model_path)

My plan is to deploy this to a SageMaker endpoint but am having trouble re-loading the model from the local file system. I keep getting the following error when I call model = StableCascadeCombinedPipeline.from_pretrained("model/", variant="bf16", torch_dtype=torch.float16):
image

Been at this for several days now, not sure what I'm doing wrong.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.