Skip to content

Commit

Permalink
some notebook updates (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
yisding authored Apr 19, 2024
1 parent d6ab0aa commit 70b5dc3
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 42 deletions.
12 changes: 6 additions & 6 deletions examples/demo_advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions examples/demo_advanced_astradb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_astradb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_insurance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_json.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions examples/demo_json_parsing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_languages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-parse"
"%pip install llama-index llama-parse"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion examples/demo_mongodb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
16 changes: 8 additions & 8 deletions examples/demo_parsing_instructions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}
],
"source": [
"!pip install llama-parse"
"%pip install llama-parse"
]
},
{
Expand Down Expand Up @@ -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:"
]
Expand All @@ -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\")"
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions examples/demo_table_comparisons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/other_files/demo_ppt_financial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down

0 comments on commit 70b5dc3

Please sign in to comment.