Skip to content

Commit

Permalink
Only get_embedding once
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
scottleibrand authored Dec 23, 2022
1 parent 838f000 commit ae45a48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/Obtain_dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"\n",
"# This will take just between 5 and 10 minutes\n",
"df['ada_similarity'] = df.combined.apply(lambda x: get_embedding(x, engine='text-embedding-ada-002'))\n",
"df['ada_search'] = df.combined.apply(lambda x: get_embedding(x, engine='text-embedding-ada-002'))\n",
"df['ada_search'] = df['ada_similarity']\n",
"df.to_csv('data/fine_food_reviews_with_embeddings_1k.csv')"
]
}
Expand Down

0 comments on commit ae45a48

Please sign in to comment.