fix embedding model change and quick code edits

pull/1103/head
Ankur Rastogi 3 months ago
parent bed41103a2
commit 161f9fa28f

@ -105,7 +105,7 @@
"import pinecone\n", "import pinecone\n",
"\n", "\n",
"# I've set this to our new embeddings model, this can be changed to the embedding model of your choice\n", "# I've set this to our new embeddings model, this can be changed to the embedding model of your choice\n",
"EMBEDDING_MODEL = \"text-embedding-3-small\"\n", "EMBEDDING_MODEL = \"text-embedding-ada-002\"\n",
"\n", "\n",
"# Ignore unclosed SSL socket warnings - optional in case you get these errors\n", "# Ignore unclosed SSL socket warnings - optional in case you get these errors\n",
"import warnings\n", "import warnings\n",
@ -532,7 +532,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": null,
"id": "3c8c2aa1", "id": "3c8c2aa1",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -548,7 +548,7 @@
" )[\"data\"][0]['embedding']\n", " )[\"data\"][0]['embedding']\n",
"\n", "\n",
" # Query namespace passed as parameter using title vector\n", " # Query namespace passed as parameter using title vector\n",
" query_result = index.query(embedded_query, \n", " query_result = index.query(vector=embedded_query, \n",
" namespace=namespace, \n", " namespace=namespace, \n",
" top_k=top_k)\n", " top_k=top_k)\n",
"\n", "\n",
@ -567,7 +567,7 @@
" })\n", " })\n",
" \n", " \n",
" counter = 0\n", " counter = 0\n",
" for k,v in df.iterrows():\n", " for _,v in df.iterrows():\n",
" counter += 1\n", " counter += 1\n",
" print(f'{v.title} (score = {v.score})')\n", " print(f'{v.title} (score = {v.score})')\n",
" \n", " \n",
@ -629,14 +629,6 @@
"source": [ "source": [
"content_query_output = query_article(\"Famous battles in Scottish history\",'content')" "content_query_output = query_article(\"Famous battles in Scottish history\",'content')"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0119d87a",
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {

Loading…
Cancel
Save