Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,18 +3,20 @@ import streamlit.components.v1 as components # Import Streamlit
|
|
3 |
|
4 |
from logic import get_index,get_network_graph,get_embeddings,get_visualize_embeddings
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
3 |
|
4 |
from logic import get_index,get_network_graph,get_embeddings,get_visualize_embeddings
|
5 |
|
6 |
+
token = st.text_input("Open-AI-api-key-3.5-GPT")
|
7 |
+
if (token != ''):
|
8 |
+
text = st.text_input("Input Links Seperated by ','")
|
9 |
+
links = text.split(",")
|
10 |
+
|
11 |
+
index = get_index(links,token)
|
12 |
+
get_network_graph(index)
|
13 |
+
emb = get_embeddings(index)
|
14 |
+
fig = get_visualize_embeddings(emb)
|
15 |
+
|
16 |
+
# Plotly Chart
|
17 |
+
st.plotly_chart(fig, use_container_width=True)
|
18 |
+
|
19 |
+
# Render the h1 block, contained in a frame of size 200x200.
|
20 |
+
HtmlFile = open("kuzugraph_draw3.html", 'r', encoding='utf-8')
|
21 |
+
source_code = HtmlFile.read()
|
22 |
+
components.html(source_code)
|