summaryrefslogtreecommitdiff
path: root/setup_cont.py
diff options
context:
space:
mode:
authorNate Buttke <nate-web@riseup.net>2023-07-25 22:40:00 -0700
committerNate Buttke <nate-web@riseup.net>2023-07-25 22:40:00 -0700
commit0985b7f2d467ecbeba0c6ca51ba03236cd4ff929 (patch)
tree5c24e8f12cd4416c69c5a37c365af34a1119a47f /setup_cont.py
hi dan
Diffstat (limited to 'setup_cont.py')
-rw-r--r--setup_cont.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/setup_cont.py b/setup_cont.py
new file mode 100644
index 0000000..360c9f9
--- /dev/null
+++ b/setup_cont.py
@@ -0,0 +1,16 @@
+import ast
+from collections import defaultdict
+import os
+import pandas as pd
+import openai
+import tiktoken
+from openai.embeddings_utils import get_embedding, cosine_similarity
+
+openai.api_key = os.getenv('END_OF_WORLD')
+
+df=pd.read_csv("setup_dataWithSummary.csv")
+embedding_model = "text-embedding-ada-002"
+df["embedding_summary"] = df.summary.apply([lambda x: get_embedding(x, engine=embedding_model)])
+print(df)
+
+df.to_csv('setup_dataWithSummaryEmbed.csv')