Only get_embedding once

fd181ec78f 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.
This commit is contained in:
Scott Leibrand 2022-12-23 12:30:26 -08:00 committed by GitHub
parent c2ff1460c4
commit 72b8e83b0c

View File

@ -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')"
]
}