Skip to content

Commit d645a29

Browse files
ovalle15ovalle15
andauthored
small updates to text (#1583)
Co-authored-by: ovalle15 <aovalle@Andreas-MacBook-Pro-2.local>
1 parent 69ab9f9 commit d645a29

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/basics/custom_embeddings_sdk.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
{
146146
"metadata": {},
147147
"source": [
148-
"data_row_dict = [{\"data_row_id\": dr[\"data_row\"][\"id\"], \"row_data\": dr[\"data_row\"][\"row_data\"]} for dr in data_rows]\n",
148+
"data_row_dict = [{\"data_row_id\": dr[\"data_row\"][\"id\"]} for dr in data_rows]\n",
149149
"data_row_dict = data_row_dict[:1000] # keep the first 1000 examples for the sake of this demo"
150150
],
151151
"cell_type": "code",
@@ -221,8 +221,7 @@
221221
{
222222
"metadata": {},
223223
"source": [
224-
"- The payload should encompass all the data you wish to retain, along with the new embeddings vector data.\n",
225-
"- `row_data` and `key` is required when using `dataset.upsert_data_rows()` "
224+
"The payload should encompass the `key` (data row id or global key) and the new embedding vector data. Note that the `dataset.upsert_data_rows()` operation will only update the values you pass in the payload; all other existing row data will not be modified."
226225
],
227226
"cell_type": "markdown"
228227
},
@@ -231,7 +230,7 @@
231230
"source": [
232231
"payload = []\n",
233232
"for data_row_dict, custom_embedding in zip(data_row_dict,custom_embeddings):\n",
234-
" payload.append({\"key\": lb.UniqueId(data_row_dict['data_row_id']), \"row_data\": data_row_dict['row_data'], \"embeddings\": [{\"embedding_id\": embedding.id, \"vector\": custom_embedding}]})\n",
233+
" payload.append({\"key\": lb.UniqueId(data_row_dict['data_row_id']), \"embeddings\": [{\"embedding_id\": embedding.id, \"vector\": custom_embedding}]})\n",
235234
"\n",
236235
"print('payload', len(payload),payload[:1])"
237236
],

0 commit comments

Comments
 (0)