mirror of
https://github.com/openai/openai-cookbook
synced 2024-11-04 06:00:33 +00:00
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:
parent
c2ff1460c4
commit
72b8e83b0c
@ -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…
Reference in New Issue
Block a user