Issue with Inference API for ViT Model - "image-feature-extraction" Error
I’m experiencing an issue with the inference API for my Vision Transformer (ViT) model, rshrott/vit-base-renovation2.huggingface.corshrott/vit-base-renovation2 · Hugging FaceWe’re on a journey to advance and democratize artificial intelligence through open source and open science.When I attempt to use the API, I receive the following error:{“error”: "HfApiJson(Deserialize(Error(“unknown variantimage-feature-extraction, expected one ofaudio-classification,audio-to-audio,audio-source-separation,automatic-speech-recognition,feature-extraction,text-classification,token-classification,question-answering,translation,summarization,text-generation,text2text-generation,fill-mask,zero-shot-classification,zero-shot-image-classification,conversational,table-question-answering,image-classification,image-segmentation,image-to-text,text-to-speech, …visual-question-answering,video-classification,document-question-answering,image-to-image,depth-estimation, line: 1, column: 318)))”}Interestingly, when I use the transformers pipeline directly in Python, the model works as expected:from transformers import pipelinefrom PIL import Imageimport requestspipe = pipeline(model=“rshrott/vit-base-renovation2”)url = ‘https://example.com/image.jpeg’image = Image.open(requests.get(url, stream=True).raw)preds = pipe(image)This code runs without any issues and returns the expected predictions. However, the same model encounters an error when used through the inference API. I suspect there might be a configuration issue related to the expected task type, but I’m not sure how to resolve it.Could you please help me understand why this error is occurring and how I can fix it? I’ve checked the model card and configuration, but I can’t seem to find where “image-feature-extraction” is coming from or why it’s expected.Thank you for your assistance!
2024-04-13T21:33:56Z
Did you find the solution ? Because I am facing the same problem
2024-05-25T14:22:50Z
i faced the same error, did you solve it?
2024-05-27T10:00:03Z
Thanks for reporting, have forwarded it to the team.
2024-05-31T02:56:40Z
I think I figured it out. Even though it seems ridiculous, when I removed the YAML metadata from the README.md, it worked.
2024-05-31T08:46:27Z
Hi all! The issue was due to the base_model being pointed and a parsing error with this specific model. We’re fixing things on our side, it should work soon
2024-06-07T16:25:29Z
Any updates?
2024-06-07T23:17:43Z
HiThe fix has been deployed.