Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae45a48

Browse files
Only get_embedding once
openai@fd181ec updated what was previously two different get_embedding() calls w/ different models to be two identical calls. Rather than doing the same API call twice in a row, we can now just set the second variable to be equal to the first one.
1 parent 838f000 commit ae45a48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/Obtain_dataset.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"\n",
163163
"# This will take just between 5 and 10 minutes\n",
164164
"df['ada_similarity'] = df.combined.apply(lambda x: get_embedding(x, engine='text-embedding-ada-002'))\n",
165-
"df['ada_search'] = df.combined.apply(lambda x: get_embedding(x, engine='text-embedding-ada-002'))\n",
165+
"df['ada_search'] = df['ada_similarity']\n",
166166
"df.to_csv('data/fine_food_reviews_with_embeddings_1k.csv')"
167167
]
168168
}

0 commit comments

Comments
 (0)