mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 05:43:55 +00:00
Cookbook for multi-modal RAG eval (#13272)
This commit is contained in:
parent
50a5c919f0
commit
39852dffd2
802
cookbook/advanced_rag_eval.ipynb
Normal file
802
cookbook/advanced_rag_eval.ipynb
Normal file
File diff suppressed because one or more lines are too long
@ -410,6 +410,16 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"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",
|
"docs = retriever.get_relevant_documents(\"Woman with children\",k=10)\n",
|
||||||
"for doc in docs:\n",
|
"for doc in docs:\n",
|
||||||
" if is_base64(doc.page_content):\n",
|
" if is_base64(doc.page_content):\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user