Model Inference Not Working

#1
by jais8004 - opened
1 import requests
2 from PIL import Image
----> 3 from transformers import Pix2StructForConditionalGeneration, Pix2StructProcessor
5 url = "https://www.ilankelman.org/stopsigns/australia.jpg"
6 image = Image.open(requests.get(url, stream=True).raw)

ImportError: cannot import name 'Pix2StructForConditionalGeneration' from 'transformers' (c:\Users\JAIS\Anaconda3\envs\hftest\lib\site-packages\transformers_init_.py)

Also Not Able to inference from Hugging Face UI for all the variants of this model
Error Message : "The model_type 'pix2struct' is not recognized. It could be a bleeding edge model, or incorrect"

image.png

image.png

Hi @jais8004
Thanks a lot for the ping!
Please use the main branch of transformers to properly use Pix2Struct:

pip install git+https://github.com/huggingface/transformers.git

Regarding the inference widget, this will be updated and fixed soon, thanks!

Sign up or log in to comment