Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 72610de

Browse files
committed
changes for breaking api changes to embed jobs
1 parent 66748bf commit 72610de

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

notebooks/Embed_Jobs_Semantic_Search.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@
145145
"job = co.create_embed_job(\n",
146146
" dataset_id=ds.id,\n",
147147
" input_type='search_document' ,\n",
148-
" model='embed-english-v3.0')\n",
148+
" model='embed-english-v3.0', \n",
149+
" embeddings_types=['float'])\n",
149150
"\n",
150151
"job.wait() # poll the server until the job is completed "
151152
]
@@ -228,7 +229,7 @@
228229
"embeddings=[]\n",
229230
"texts=[]\n",
230231
"for record in output_dataset:\n",
231-
" embeddings.append(record['embedding'])\n",
232+
" embeddings.append(record['embeddings']['float'])\n",
232233
" texts.append(record['text'])"
233234
]
234235
},

notebooks/Embed_Jobs_Serverless_Pinecone_Semantic_Search.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@
146146
"# Dataset has been uploaded, create an embed job and specify the input type as \"search document\" since this will live in your Pinecone DB\n",
147147
"job = co.create_embed_job(dataset_id=ds.id,\n",
148148
" input_type='search_document',\n",
149-
" model='embed-english-v3.0')\n",
149+
" model='embed-english-v3.0',\n",
150+
" embeddings_types=['float'])\n",
150151
"\n",
151152
"job.wait() # poll the server until the job is completed "
152153
]
@@ -220,7 +221,7 @@
220221
"# Take the output and format it in the shape for upserting into Pinecone's DB\n",
221222
"ids = [str(i) for i in range(len(data_array))]\n",
222223
"meta = [{'text':str(data_array[i]['text'])} for i in range(len(data_array))]\n",
223-
"embeds=[np.float32(data_array[i]['embedding']) for i in range(len(data_array))]\n",
224+
"embeds=[np.float32(data_array[i]['embeddings']['float']) for i in range(len(data_array))]\n",
224225
"\n",
225226
"to_upsert = list(zip(ids, embeds, meta))"
226227
]

0 commit comments

Comments
 (0)