Spaces:
Sleeping
Sleeping
Commit
·
532fd13
1
Parent(s):
f7993f7
fix
Browse files- original.ipynb +11 -2
original.ipynb
CHANGED
@@ -64,12 +64,13 @@
|
|
64 |
"cell_type": "markdown",
|
65 |
"metadata": {},
|
66 |
"source": [
|
|
|
67 |
"Now we will create an index file from the documents using the model. Usually this is part is the most resource intensive part, so it's recommended to create this file offline."
|
68 |
]
|
69 |
},
|
70 |
{
|
71 |
"cell_type": "code",
|
72 |
-
"execution_count":
|
73 |
"metadata": {},
|
74 |
"outputs": [],
|
75 |
"source": [
|
@@ -79,6 +80,14 @@
|
|
79 |
"faiss.write_index(index, index_path) # Write the index to the file"
|
80 |
]
|
81 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
{
|
83 |
"cell_type": "code",
|
84 |
"execution_count": 50,
|
@@ -130,7 +139,7 @@
|
|
130 |
"cell_type": "markdown",
|
131 |
"metadata": {},
|
132 |
"source": [
|
133 |
-
"
|
134 |
"\n",
|
135 |
"Retrieval-Augmented Generation (RAG) enhances language model responses by incorporating external knowledge retrieval. To maximize performance, consider the following techniques and optimizations:\n",
|
136 |
"\n",
|
|
|
64 |
"cell_type": "markdown",
|
65 |
"metadata": {},
|
66 |
"source": [
|
67 |
+
"## Ingestion Phase\n",
|
68 |
"Now we will create an index file from the documents using the model. Usually this is part is the most resource intensive part, so it's recommended to create this file offline."
|
69 |
]
|
70 |
},
|
71 |
{
|
72 |
"cell_type": "code",
|
73 |
+
"execution_count": null,
|
74 |
"metadata": {},
|
75 |
"outputs": [],
|
76 |
"source": [
|
|
|
80 |
"faiss.write_index(index, index_path) # Write the index to the file"
|
81 |
]
|
82 |
},
|
83 |
+
{
|
84 |
+
"cell_type": "markdown",
|
85 |
+
"metadata": {},
|
86 |
+
"source": [
|
87 |
+
"# Retrieval Phase\n",
|
88 |
+
"The index database is ready. Now we a encode a query aswell and compare this to our documents. This retrieval method will rank our documents based on how similar (distance) it is to our query."
|
89 |
+
]
|
90 |
+
},
|
91 |
{
|
92 |
"cell_type": "code",
|
93 |
"execution_count": 50,
|
|
|
139 |
"cell_type": "markdown",
|
140 |
"metadata": {},
|
141 |
"source": [
|
142 |
+
"## Optimizing Retrieval-Augmented Generation (RAG) Implementation\n",
|
143 |
"\n",
|
144 |
"Retrieval-Augmented Generation (RAG) enhances language model responses by incorporating external knowledge retrieval. To maximize performance, consider the following techniques and optimizations:\n",
|
145 |
"\n",
|