Skip to content

Commit

Permalink
Fixed local saving to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
aevedisatrgi committed Feb 16, 2024
1 parent 669d5bb commit 96a3dd3
Showing 1 changed file with 12 additions and 62 deletions.
74 changes: 12 additions & 62 deletions docs/examples/vector_stores/QdrantIndexDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install llama-index-vector-stores-qdrant"
"%pip install llama-index llama-index-vector-stores-qdrant llama-index-embeddings-openai llama-index-llms-openai"
]
},
{
Expand Down Expand Up @@ -72,7 +72,7 @@
"metadata": {},
"outputs": [],
"source": [
"os.environ[\"OPENAI_API_KEY\"] = \"YOUR OPENAI API KEY\""
"os.environ[\"OPENAI_API_KEY\"] = \"YOU OPENAI KEY HERE\""
]
},
{
Expand Down Expand Up @@ -140,13 +140,14 @@
"metadata": {},
"outputs": [],
"source": [
"path = \"./data/paul_graham\"\n",
"client = qdrant_client.QdrantClient(\n",
" # you can use :memory: mode for fast and light-weight experiments,\n",
" # it does not require to have Qdrant deployed anywhere\n",
" # but requires qdrant-client >= 1.1.1\n",
" location=\":memory:\"\n",
" # otherwise set Qdrant instance address with:\n",
" # uri=\"http://<host>:<port>\"\n",
" #location=\":memory:\"\n",
" # otherwise save locally to disk for future retrieval purposes:\n",
" path=path\n",
" # set API KEY for Qdrant Cloud\n",
" # api_key=\"<qdrant-api-key>\",\n",
")"
Expand Down Expand Up @@ -192,20 +193,7 @@
"execution_count": null,
"id": "77a864c7",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<b>The author worked on writing and programming outside of school before college. They wrote short stories and tried writing programs on the IBM 1401 computer. They also mentioned getting a microcomputer, specifically a TRS-80, and started programming on it.</b>"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(Markdown(f\"<b>{response}</b>\"))"
]
Expand All @@ -229,20 +217,7 @@
"execution_count": null,
"id": "926b79da",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<b>After his time at Viaweb, the author decided to pursue his passion for painting. He left Yahoo, where he had been working after Viaweb was acquired, and immediately started painting. However, he struggled with energy and ambition, and eventually returned to New York to resume his old life as a painter.</b>"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(Markdown(f\"<b>{response}</b>\"))"
]
Expand Down Expand Up @@ -331,20 +306,7 @@
"execution_count": null,
"id": "c88ff475",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<b>The author worked on writing and programming outside of school. They wrote short stories and tried writing programs on the IBM 1401 computer. They also built a microcomputer and started programming on it, writing simple games and a word processor.</b>"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(Markdown(f\"<b>{response}</b>\"))"
]
Expand All @@ -368,20 +330,7 @@
"execution_count": null,
"id": "90e1fa0e",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<b>After his time at Viaweb, the author started working on a new idea. He decided to move to Cambridge and start a new company. However, he faced difficulties in finding a partner to work on the idea with him. Eventually, he recruited a team and began building a new dialect of Lisp called Arc. He also gave a talk at a Lisp conference and posted a file of the talk online, which gained a significant audience.</b>"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(Markdown(f\"<b>{response}</b>\"))"
]
Expand All @@ -402,7 +351,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 96a3dd3

Please sign in to comment.