Polo123's picture
Update app.py
6c3f62c verified
raw
history blame
748 Bytes
import streamlit as st
import streamlit.components.v1 as components # Import Streamlit
from logic import get_index,get_network_graph,get_embeddings,get_visualize_embeddings
token = st.text_input("Open-AI-api-key-3.5-GPT")
if (token != ''):
text = st.text_input("Input Links Seperated by ','")
links = text.split(",")
index = get_index(links,token)
get_network_graph(index)
emb = get_embeddings(index)
fig = get_visualize_embeddings(emb)
# Plotly Chart
st.plotly_chart(fig, use_container_width=True)
# Render the h1 block, contained in a frame of size 200x200.
HtmlFile = open("kuzugraph_draw3.html", 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code)