mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +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
838f000935
commit
ae45a48de3
@ -162,7 +162,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"# This will take just between 5 and 10 minutes\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_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')"
|
"df.to_csv('data/fine_food_reviews_with_embeddings_1k.csv')"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user