Compare commits

...

1 Commits

Author SHA1 Message Date
Yi Ding 203361b138 some notebook updates 2024-04-18 10:30:44 -07:00
12 changed files with 43 additions and 42 deletions
+6 -6
View File
@@ -19,12 +19,12 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-core\n",
"!pip install llama-index-embeddings-openai\n",
"!pip install llama-index-postprocessor-flag-embedding-reranker\n",
"!pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"!pip install llama-parse"
"%pip install llama-index\n",
"%pip install llama-index-core\n",
"%pip install llama-index-embeddings-openai\n",
"%pip install llama-index-postprocessor-flag-embedding-reranker\n",
"%pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"%pip install llama-parse"
]
},
{
+7 -7
View File
@@ -17,13 +17,13 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-core==0.10.6.post1\n",
"!pip install llama-index-embeddings-openai\n",
"!pip install llama-index-postprocessor-flag-embedding-reranker\n",
"!pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"!pip install llama-parse\n",
"!pip install llama-index-vector-stores-astra-db"
"%pip install llama-index\n",
"%pip install llama-index-core==0.10.6.post1\n",
"%pip install llama-index-embeddings-openai\n",
"%pip install llama-index-postprocessor-flag-embedding-reranker\n",
"%pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"%pip install llama-parse\n",
"%pip install llama-index-vector-stores-astra-db"
]
},
{
+1 -1
View File
@@ -28,7 +28,7 @@
"outputs": [],
"source": [
"# First, install the required dependencies\n",
"!pip install --quiet llama-index llama-parse llama-index-vector-stores-astra-db llama-index-llms-openai"
"%pip install --quiet llama-index llama-parse llama-index-vector-stores-astra-db llama-index-llms-openai"
]
},
{
+1 -1
View File
@@ -13,7 +13,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
+1 -1
View File
@@ -24,7 +24,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
+1 -1
View File
@@ -206,7 +206,7 @@
" for image_dict in image_dicts:\n",
" image_doc = ImageDocument(image_path=image_dict[\"path\"])\n",
" response = anthropic_mm_llm.complete(\n",
" prompt=\"Describe the images as an alternative text\",\n",
" prompt=\"Describe the images as alt text\",\n",
" image_documents=[image_doc],\n",
" )\n",
" text_node = TextNode(text=str(response), metadata={\"path\": image_dict[\"path\"]})\n",
+5 -5
View File
@@ -33,11 +33,11 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-core\n",
"!pip install llama-index-llms-anthropic llama-index-multi-modal-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface\n",
"!pip install llama-parse"
"%pip install llama-index\n",
"%pip install llama-index-core\n",
"%pip install llama-index-llms-anthropic llama-index-multi-modal-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface\n",
"%pip install llama-parse"
]
},
{
+1 -1
View File
@@ -21,7 +21,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
+2 -1
View File
@@ -29,7 +29,8 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse pip install llama-index-vector-stores-mongodb llama-index-llms-openai"
"%pip install llama-index llama-parse\n",
"%pip install llama-index-vector-stores-mongodb llama-index-llms-openai"
]
},
{
+8 -8
View File
@@ -114,7 +114,7 @@
}
],
"source": [
"!pip install llama-parse"
"%pip install llama-parse"
]
},
{
@@ -294,7 +294,7 @@
"### Using parsing instructions\n",
"Let's try to parse the manga with custom instructions:\n",
"\n",
"\"The provided document is a manga comic book. Most pages do NOT have title. It does not contain tables. Try to reconstruct the dialogue happening in a cohesive way.\"\n",
"\"The provided document is a manga comic book. Most pages do NOT have a title. It does not contain tables. Try to reconstruct the dialogue spoken in a cohesive way.\"\n",
"\n",
"To do so just pass the parsing instruction as a parameter to LlamaParse:"
]
@@ -314,9 +314,9 @@
}
],
"source": [
"parsingInstructionManga = \"\"\"The provided document is a manga comic book, most page do NOT have title.\n",
"It does not contain table.\n",
"Try to reconstruct the dialog happening in a cohesive way.\"\"\"\n",
"parsingInstructionManga = \"\"\"The provided document is a manga comic book. Most pages do NOT have a title.\n",
"It does not contain tables.\n",
"Try to reconstruct the dialogue spoken in a cohesive way.\"\"\"\n",
"withInstructionParsing = LlamaParse(\n",
" result_type=\"markdown\", parsing_instruction=parsingInstructionManga\n",
").load_data(\"./manga.pdf\")"
@@ -404,9 +404,9 @@
}
],
"source": [
"parsingInstructionMangaLatex = \"\"\"The provided document is a manga comic book, most page do NOT have title.\n",
"It does not contain table. Do not output table.\n",
"Try to reconstruct the dialog happening in a cohesive way.\n",
"parsingInstructionMangaLatex = \"\"\"The provided document is a manga comic book. Most pages do NOT have a title.\n",
"It does not contain tables.\n",
"Try to reconstruct the dialogue spoken in a cohesive way.\n",
"Output any math equation in LATEX markdown (between $$)\"\"\"\n",
"withLatex = LlamaParse(\n",
" result_type=\"markdown\", parsing_instruction=parsingInstructionMangaLatex\n",
+7 -7
View File
@@ -28,13 +28,13 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-core\n",
"!pip install llama-index-embeddings-openai\n",
"!pip install llama-index-question-gen-openai\n",
"!pip install llama-index-postprocessor-flag-embedding-reranker\n",
"!pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"!pip install llama-parse"
"%pip install llama-index\n",
"%pip install llama-index-core\n",
"%pip install llama-index-embeddings-openai\n",
"%pip install llama-index-question-gen-openai\n",
"%pip install llama-index-postprocessor-flag-embedding-reranker\n",
"%pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
"%pip install llama-parse"
]
},
{
@@ -26,9 +26,9 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-parse\n",
"!pip install torch transformers python-pptx Pillow"
"%pip install llama-index\n",
"%pip install llama-parse\n",
"%pip install torch transformers python-pptx Pillow"
]
},
{