Skip to content

Examples and guides for using the OpenAI API

Tested notebook end to end

colin-openaia37477f9bce1
diff --git a/examples/vector_databases/Using_vector_databases_for_embeddings_search.ipynb b/examples/vector_databases/Using_vector_databases_for_embeddings_search.ipynb
index 9347621e..32270450 100644
--- a/examples/vector_databases/Using_vector_databases_for_embeddings_search.ipynb
+++ b/examples/vector_databases/Using_vector_databases_for_embeddings_search.ipynb
@@ -63,7 +63,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
"id": "5be94df6",
"metadata": {},
"outputs": [],
@@ -111,7 +111,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 2,
"id": "bd99e08e",
"metadata": {},
"outputs": [],
@@ -172,10 +172,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
"id": "0c1c73cb",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "Found cached dataset wikipedia (/Users/colin.jarvis/.cache/huggingface/datasets/wikipedia/20220301.simple/2.0.0/aa542ed919df55cc5d3347f42dd4521d05ca68751f50dbc32bae2a7f1e167559)\n"
+ ]
+ },
+ {
+ "data": {
+ "application/vnd.jupyter.widget-view+json": {
+ "model_id": "6aa3a11d70424916915334e267f4964b",
+ "version_major": 2,
+ "version_minor": 0
+ },
+ "text/plain": [
+ " 0%| | 0/1 [00:00<?, ?it/s]"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"# We'll use the datasets library to pull the Simple Wikipedia dataset for embedding\n",
"dataset = list(load_dataset(\"wikipedia\", \"20220301.simple\")[\"train\"])\n",
@@ -185,7 +207,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 12,
"id": "e6ee90ce",
"metadata": {},
"outputs": [
@@ -200,15 +222,15 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "25024it [01:11, 348.92it/s] "
+ "25024it [00:59, 423.81it/s] "
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
- "CPU times: user 15.8 s, sys: 1.96 s, total: 17.8 s\n",
- "Wall time: 1min 14s\n"
+ "CPU times: user 17.9 s, sys: 3.15 s, total: 21 s\n",
+ "Wall time: 1min 1s\n"
]
},
{
@@ -227,7 +249,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 5,
"id": "850c7215",
"metadata": {},
"outputs": [
@@ -242,7 +264,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "25024it [00:21, 1164.97it/s] \n"
+ "25024it [00:40, 616.58it/s] \n"
]
}
],
@@ -253,7 +275,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 13,
"id": "1410daaa",
"metadata": {},
"outputs": [
@@ -372,7 +394,7 @@
"4 [0.021524671465158463, 0.018522677943110466, -... 4 "
]
},
- "execution_count": 17,
+ "execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
@@ -406,7 +428,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 11,
"id": "92e6152a",
"metadata": {},
"outputs": [],
@@ -715,7 +737,7 @@
},
{
"cell_type": "code",
- "execution_count": 33,
+ "execution_count": null,
"id": "b9ea472d",
"metadata": {},
"outputs": [],
@@ -725,21 +747,10 @@
},
{
"cell_type": "code",
- "execution_count": 34,
+ "execution_count": null,
"id": "13be220d",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "{'classes': []}"
- ]
- },
- "execution_count": 34,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"client.schema.delete_all()\n",
"client.schema.get()"
@@ -747,21 +758,10 @@
},
{
"cell_type": "code",
- "execution_count": 35,
+ "execution_count": null,
"id": "73d33184",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 35,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"client.is_ready()"
]
@@ -1095,7 +1095,7 @@
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 7,
"id": "76d697e9",
"metadata": {
"ExecuteTime": {
@@ -1110,7 +1110,7 @@
},
{
"cell_type": "code",
- "execution_count": 29,
+ "execution_count": 8,
"id": "1deeb539",
"metadata": {
"ExecuteTime": {
@@ -1125,7 +1125,7 @@
"CollectionsResponse(collections=[])"
]
},
- "execution_count": 29,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}