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.
pull/46/head
Scott Leibrand 2 years ago committed by GitHub
parent 838f000935
commit ae45a48de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save