Spaces:
Sleeping
Sleeping
Update logic.py
Browse files
logic.py
CHANGED
@@ -22,8 +22,8 @@ import numpy as np
|
|
22 |
import plotly.express as px
|
23 |
import umap
|
24 |
|
25 |
-
def get_index(links):
|
26 |
-
os.environ["OPENAI_API_KEY"] = userdata.get('oai')
|
27 |
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
28 |
|
29 |
db = kuzu.Database("kg1")
|
@@ -34,7 +34,7 @@ def get_index(links):
|
|
34 |
links
|
35 |
)
|
36 |
|
37 |
-
llm = OpenAI(temperature=0, model="gpt-3.5-turbo",api_key=
|
38 |
service_context = ServiceContext.from_defaults(llm=llm, chunk_size=512)
|
39 |
|
40 |
storage_context = StorageContext.from_defaults(graph_store=graph_store)
|
@@ -92,55 +92,3 @@ def get_visualize_embeddings(embedding_series, n_neighbors=15, min_dist=0.1, n_c
|
|
92 |
|
93 |
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
22 |
import plotly.express as px
|
23 |
import umap
|
24 |
|
25 |
+
def get_index(links,token):
|
26 |
+
#os.environ["OPENAI_API_KEY"] = userdata.get('oai')
|
27 |
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
28 |
|
29 |
db = kuzu.Database("kg1")
|
|
|
34 |
links
|
35 |
)
|
36 |
|
37 |
+
llm = OpenAI(temperature=0, model="gpt-3.5-turbo",api_key=token)
|
38 |
service_context = ServiceContext.from_defaults(llm=llm, chunk_size=512)
|
39 |
|
40 |
storage_context = StorageContext.from_defaults(graph_store=graph_store)
|
|
|
92 |
|
93 |
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|