moondream
moondream copied to clipboard
Running transformers is stuck at a point
I am trying to run the code in the example
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image
model_id = "vikhyatk/moondream2"
revision = "2024-05-20"
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True, revision=revision
)
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)
image = Image.open('<IMAGE_PATH>')
enc_image = model.encode_image(image)
print(model.answer_question(enc_image, "Describe this image.", tokenizer))
But for some reason at the model.answer_question(enc_image, "Describe this image.", tokenizer)
the program is stuck and when I KeyboardInterrupt it I get this as the trace
Any help is much appreciated, thanks