Skip to content

Commit

Permalink
fix: Remove a problematic scenario for Gemini Flash model (#1250)
Browse files Browse the repository at this point in the history
# Description

The PDF analysis with both PDF and images scenario is consistently
failing on Flash model so temporary remove the scenario from the
example.
  • Loading branch information
gericdong authored Oct 11, 2024
1 parent d18dd5a commit bfc2194
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions gemini/getting-started/intro_gemini_1_5_flash.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -509,67 +509,6 @@
"print(response.text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "52ltdcv5EsaM"
},
"outputs": [],
"source": [
"image_file_path = \"cloud-samples-data/generative-ai/image/cumulative-average.png\"\n",
"image_file_url = f\"https://storage.googleapis.com/{image_file_path}\"\n",
"image_file_uri = f\"gs://{image_file_path}\"\n",
"\n",
"IPython.display.Image(image_file_url, width=450)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "EEmrMpRMHyel"
},
"outputs": [],
"source": [
"prompt = \"\"\"\n",
"Task: Answer the following questions based on a PDF document and image file provided in the context.\n",
"\n",
"Instructions:\n",
"- Look through the image and the PDF document carefully and answer the question.\n",
"- Give a short and terse answer to the following question.\n",
"- Do not paraphrase or reformat the text you see in the image.\n",
"- Cite the source of page number for the PDF document provided as context.\n",
"\n",
" Questions:\n",
" - What is in the given image?\n",
" - Is there a similar graph in the given document?\n",
"\n",
"Context:\n",
"\"\"\"\n",
"\n",
"pdf_file = Part.from_uri(pdf_file_uri, mime_type=\"application/pdf\")\n",
"image_file = Part.from_uri(image_file_uri, mime_type=\"image/png\")\n",
"\n",
"contents = [\n",
" pdf_file,\n",
" image_file,\n",
" prompt,\n",
"]\n",
"\n",
"response = model.generate_content(contents)\n",
"print(response.text)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "RIwBUZTyLJh0"
},
"source": [
"Gemini 1.5 Flash is able to identify and locate the graph on page 10 from the PDF document.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down

0 comments on commit bfc2194

Please sign in to comment.