Cookbook for multi-modal RAG eval (#13272)

This commit is contained in:
Lance Martin
2023-11-13 14:26:02 -08:00
committed by GitHub
parent 50a5c919f0
commit 39852dffd2
2 changed files with 812 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -410,6 +410,16 @@
}
],
"source": [
"from IPython.display import display, HTML\n",
"\n",
"def plt_img_base64(img_base64):\n",
"\n",
" # Create an HTML img tag with the base64 string as the source\n",
" image_html = f'<img src=\"data:image/jpeg;base64,{img_base64}\" />'\n",
" \n",
" # Display the image by rendering the HTML\n",
" display(HTML(image_html))\n",
"\n",
"docs = retriever.get_relevant_documents(\"Woman with children\",k=10)\n",
"for doc in docs:\n",
" if is_base64(doc.page_content):\n",