Spaces:
Build error
Build error
import streamlit as st | |
from topics import Insights | |
import time | |
st.title("Drop the first document") | |
file1 = st.file_uploader("Upload a file", type=["md", "txt"], key="first") | |
st.title("Drop the second document") | |
file2 = st.file_uploader("Upload a file", type=["md", "txt"], key="second") | |
if file1 is not None and file2 is not None: | |
st.title("Generating insights") | |
with st.spinner('Generating insights...'): | |
insight1 = Insights(file1.read().decode("utf-8")) | |
insight2 = Insights(file2.read().decode("utf-8")) | |
st.write(insight1.generate_topics()) | |
st.write(insight2.generate_topics()) | |
st.write(insight1.text) | |
st.write(insight2.text) | |
embed1 = insight1.generate_embeddings() | |
embed2 = insight2.generate_embeddings() | |
st.success('Done!') |