We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Had to change the process_page() function to this for it to work (didnt seem to provide the correct "message" syntax to openai):
process_page()
def process_page(page_num): page = doc[page_num] text = page.get_text() pix = page.get_pixmap() image = Image.frombytes("RGB", [pix.width, pix.height], pix.samples) base64_image = make_image_url(image, host_images=HOST_IMAGES) # Assuming it returns a base64-encoded result messages = [ { "role": "user", "content": [ {"type": "text", "text": "```{} ```\n{}".format(text, SCRAPING_PROMPT)}, {"type": "image_url", "image_url": {"url": base64_image}}, ] }, ]
The text was updated successfully, but these errors were encountered:
same here
Sorry, something went wrong.
No branches or pull requests
Had to change the
process_page()
function to this for it to work (didnt seem to provide the correct "message" syntax to openai):The text was updated successfully, but these errors were encountered: