Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

What is the best way to enhance Gemini model with "few shot" prompting in multimodal setting?

Hello,

I am working with the Gemini 1.5 model to extract information from PDF documents and am exploring the "few-shot prompting" technique to enhance performance. Below is a simplified version of my current implementation:

 

model = GenerativeModel("gemini-1.5-pro-preview-0409", generation_config=generation_config, safety_settings=safety_settings)

pdf_file = Part.from_uri(pdf_file_uri, mime_type="application/pdf")
contents = [prompt, pdf_file]

response = model.generate_content(contents)

In this setup, I am unsure how to incorporate multiple PDFs and reference them effectively within the prompt to guide the model more specifically. Could someone advise on how to pass and reference multiple PDF examples in the prompt? Any examples or tips would be greatly appreciated.

Thank you!

 

 

0 0 464
0 REPLIES 0