Polo123 commited on
Commit
6c3f62c
·
verified ·
1 Parent(s): aa95f1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -15
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
- text = st.text_input("Input Links Seperated by ','")
7
- links = text.split(",")
8
-
9
- index = get_index(links)
10
- get_network_graph(index)
11
- emb = get_embeddings(index)
12
- fig = get_visualize_embeddings(emb)
13
-
14
- # Plotly Chart
15
- st.plotly_chart(fig, use_container_width=True)
16
-
17
- # Render the h1 block, contained in a frame of size 200x200.
18
- HtmlFile = open("kuzugraph_draw3.html", 'r', encoding='utf-8')
19
- source_code = HtmlFile.read()
20
- components.html(source_code)
 
 
 
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)