Team Ai
Datasetpublic

model-metadata/code_execution_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes25kdownloads
zai-org_GLM-Image_0.txt37 linesDownload Raw Back to root
1```CODE: 2import torch3from diffusers import DiffusionPipeline4 5# switch to "mps" for apple devices6pipe = DiffusionPipeline.from_pretrained("zai-org/GLM-Image", dtype=torch.bfloat16, device_map="cuda")7 8prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"9image = pipe(prompt).images[0]10```11 12ERROR: 13Traceback (most recent call last):14  File "/tmp/zai-org_GLM-Image_0lC9ejv.py", line 27, in <module>15    pipe = DiffusionPipeline.from_pretrained("zai-org/GLM-Image", dtype=torch.bfloat16, device_map="cuda")16  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn17    return fn(*args, **kwargs)18  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 829, in from_pretrained19    cached_folder = cls.download(20        pretrained_model_name_or_path,21    ...<14 lines>...22        **kwargs,23    )24  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn25    return fn(*args, **kwargs)26  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 1663, in download27    pipeline_class = _get_pipeline_class(28        cls,29    ...<7 lines>...30        revision=custom_revision,31    )32  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/diffusers/pipelines/pipeline_loading_utils.py", line 507, in _get_pipeline_class33    pipeline_cls = getattr(diffusers_module, class_name)34  File "/tmp/.cache/uv/environments-v2/9cda8ad78a01c546/lib/python3.13/site-packages/diffusers/utils/import_utils.py", line 1009, in __getattr__35    raise AttributeError(f"module {self.__name__} has no attribute {name}")36AttributeError: module diffusers has no attribute GlmImagePipeline. Did you mean: 'ZImagePipeline'?37