Skip to content

Generation Stuck at 0% with Emojich Model #137

Open
@thomasperge

Description

@thomasperge

When running the emoji generation script with the Emojich model, the process gets stuck at 0% and does not progress. The model initializes correctly but doesn’t generate any images.

Environment :
OS: Windows
Python Version: [v3.10.10]
pip Version: 24.2
rudalle Version: 1.1.3
torch Version: 2.4.0
tokenizers Version : 0.10.3

My script :

from rudalle.pipelines import generate_images, show
from rudalle import get_rudalle_model, get_tokenizer, get_vae
from rudalle.utils import seed_everything
import torch

device = 'cuda' if torch.cuda.is_available() else 'cpu'
fp16 = torch.cuda.is_available()

try:
    dalle = get_rudalle_model('Emojich', pretrained=True, fp16=fp16, device=device)
except RuntimeError as e:
    if 'Attempting to deserialize object on a CUDA device' in str(e):
        dalle = get_rudalle_model('Emojich', pretrained=True, fp16=False, device='cpu')
    else:
        raise

tokenizer = get_tokenizer()
vae = get_vae(dwt=True).to(device)

text = 'Дональд Трамп из лего'  # Donald Trump made of LEGO

seed_everything(42)

pil_images = []

try:
    for top_k, top_p, images_num in [
        (2048, 0.9, 4),
    ]:
        images, _ = generate_images(text, tokenizer, dalle, vae, top_k=top_k, images_num=images_num, top_p=top_p, bs=8)
        pil_images.extend(images)
except Exception as e:
    print(f"An error occurred: {e}")

if pil_images:
    show(pil_images, 4)
else:
    print("No images to display.")

Error Messages :

Using device: cpu
...
Generating images with top_k=256, top_p=0.9, images_num=4
0%| 

Feel free to adjust any details as needed!
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions