Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'VisCpmBeeTokenizer' object has no attribute 'encoder' #43

Open
Zeqiang-Lai opened this issue Mar 17, 2024 · 0 comments

Comments

@Zeqiang-Lai
Copy link

Dear authors, I meet AttributeError: 'VisCpmBeeTokenizer' object has no attribute 'encoder' when running the following code:

#!/usr/bin/env python
# encoding: utf-8
from diffusers import DiffusionPipeline
from transformers import AutoModel
from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained('openbmb/VisCPM-Paint', trust_remote_code=True)
text_encoder = AutoModel.from_pretrained('openbmb/VisCPM-Paint', trust_remote_code=True)
print('load pipeline')
pipeline = DiffusionPipeline.from_pretrained('openbmb/VisCPM-Paint', custom_pipeline="openbmb/VisCPM-Paint", text_encoder=text_encoder, tokenizer=tokenizer)

pipeline = pipeline.to('cuda')

prompt = "a photo of an astronaut riding a horse on mars"
image = pipeline(prompt).images[0]

image.save("astronaut_rides_horse.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant