Open anusonawane opened 2 months ago
@anusonawane Thank you reporting this issue. This repository is for issues related to Gemini cookbook Examples/Quickstarts bugs or improvements. For Issues/Questions related to Gemini API, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below. You can also post this issue on Google AI forum.
Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.
It sounds like you're encountering a discrepancy in the output when uploading PDF and DOC files, even though the content is identical. Here are a few potential reasons for the differences and some suggestions for troubleshooting:
Possible Reasons for Output Differences
File Parsing Differences:
Content Extraction Method:
Input Structure:
Model Limitations:
Suggestions for Troubleshooting
Check the Extraction Process:
Standardize Input Format:
Debugging Output:
Consult Documentation:
Experiment with Different Formats:
By following these steps, you should be able to identify the source of the discrepancy and potentially improve the output consistency between the two file upload methods. If the issue persists, consider reaching out to support for the specific tools or libraries you’re using for further assistance.
Description of the bug:
I'm trying two methods for file uploads:
PDF File Upload: DOC File Upload: Despite both files containing the same content, I'm noticing differences in the output. Specifically, the output response from the DOC file upload method lacks a lot of information and steps, while the PDF method works great.
Actual vs expected behavior:
Here's what I'm doing for each method:
1. PDF File Upload:
Since there is no support for direct PDF file upload, I'm converting each PDF page to an image, extracting text from the PDF, and then doing the following: `files.append(genai.upload_file(img))
for page, (text, image) in enumerate(zip(texts, files)): instruction = f"{instruction}\nPage {page+1}\n------------\n{text}\n{image}"
chat_session = model.start_chat( history=[ {"role": "user", "parts": [instruction]}, ] ) response = chat_session.send_message(prompt) print(response.text) `
2. DOC File Upload:
For the DOC file, I'm uploading it directly to Gemini:
files.append(genai.upload_file("test.docx")) instruction = f"Usage document:\n{file}" chat_session = model.start_chat( history=[ {"role": "user", "parts": [instruction]}, ] ) response = chat_session.send_message(prompt) print(response.text)
Any other information you'd like to share?
Can anyone help me understand why there is a difference in the output between these two methods? The content in both files is the same, but the response from the DOC file upload lacks information and steps compared to the PDF method. Any insights would be appreciated!