-
Dear Family, I am using the image loader as below:
The
The problem now is when I upload an image, I get the below error from Streamlit.
Full code in my GitHub repo. Thanks all! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
🤖 Hello, From the error message you provided, it seems like the issue is not with the In your case, it seems like the To debug this issue, I would suggest adding some print statements to check the contents of the image_loader = UnstructuredImageLoader(file_path, mode="single")
image_data = image_loader.load()[0]
documents.append(image_data)
print(documents) # Add this line
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1500, chunk_overlap=150)
document_chunks = text_splitter.split_documents(documents)
print(document_chunks) # And this line
embeddings = OpenAIEmbeddings()
vectorstore = Chroma.from_documents(document_chunks, embeddings) This will help you verify whether the If the If the I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
I misunderstood the usage of loader. The I am getting that error because the image had no text in it. To get to what I wanted, the loader I should use is the Salesforce ImageCaptionLoader. It will provide you a description of the image. |
Beta Was this translation helpful? Give feedback.
I misunderstood the usage of loader.
The
UnstructuredImageLoader
is used for OCR.When your image has text in it, it can extract them out and there will not be any "List out of range" error.
I am getting that error because the image had no text in it.
My code is working fine.
To get to what I wanted, the loader I should use is the Salesforce ImageCaptionLoader. It will provide you a description of the image.