Issue with `wesley7137/BlipFinetune-ScienceQA` Model in Transformers Library

#1
by giacomopedemonte - opened

Issue with wesley7137/BlipFinetune-ScienceQA Model in Transformers Library

Hello,

I am currently working with the wesley7137/BlipFinetune-ScienceQA model for a project that involves Visual Question Answering (VQA) in a scientific context. The fine-tuned aspect of this model is particularly important for my scope, as it aligns well with the specialized nature of the questions I am dealing with.

However, when I attempt to load the model using the Transformers library, I encounter the following error:

OSError: wesley7137/BlipFinetune-ScienceQA does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/wesley7137/BlipFinetune-ScienceQA/tree/main' for available files.

It seems that the required preprocessor_config.json file is missing from the model repository. Here is a snippet of the code I am using:

import requests
from PIL import Image
from transformers import AutoProcessor, AutoModelForVisualQuestionAnswering

# Initialize the processor and model for Visual Question Answering
processor = AutoProcessor.from_pretrained("wesley7137/BlipFinetune-ScienceQA")
model = AutoModelForVisualQuestionAnswering.from_pretrained("wesley7137/BlipFinetune-ScienceQA")

# Load a fixed image
img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'
image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

# Process an example question
question = "What is the main topic of the image?"
inputs = processor(image, question, return_tensors="pt")
outputs = model(**inputs)

Given the fine-tuned nature of this model, resolving this issue is crucial for my work. I have checked the provided link (https://huggingface.co/wesley7137/BlipFinetune-ScienceQA/tree/main), but the necessary preprocessor_config.json file is not present.

Could anyone provide guidance on how to resolve this issue? Is there a workaround or an alternative way to initialize the processor without this file? Any help or insights would be greatly appreciated.

Thank you for your assistance!

Feel free to customize this message with any additional details or context that might help the community understand and address your issue better.

Sign up or log in to comment