File size: 769 Bytes
33baf83 e26f3fa 408034b 41e6120 33baf83 41e6120 33baf83 41e6120 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import torch
from diffusers import ShapEPipeline
from diffusers.utils import export_to_gif
ckpt_id = "openai/shap-e"
device = torch.device("cpu")
# Attempt to load the pipeline without auth for testing
try:
pipe = ShapEPipeline.from_pretrained(ckpt_id).to(device)
except Exception as e:
print(f"Error loading model: {e}")
exit(1)
guidance_scale = 15.0
prompt = "A gentle AI voice assistant constructed from a circle ring and 3 lines that fly alongside the circle"
# Run the model with minimal parameters to troubleshoot
try:
images = pipe(prompt, guidance_scale=guidance_scale).images
gif_path = export_to_gif(images, "assistant_3d.gif")
print(f"GIF created at: {gif_path}")
except Exception as e:
print(f"Error generating images: {e}")
|