Spaces:
Sleeping
Sleeping
Delete pages/info.py
Browse files- pages/info.py +0 -33
pages/info.py
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from functions.sidebar import sidebar
|
3 |
-
from functions.web_chain import vectorize
|
4 |
-
|
5 |
-
sidebar()
|
6 |
-
|
7 |
-
st.title("Upload Data")
|
8 |
-
|
9 |
-
with st.form(key='my_form'):
|
10 |
-
|
11 |
-
uploaded_files = st.file_uploader("Upload PDFs", accept_multiple_files=True,label_visibility="hidden")
|
12 |
-
|
13 |
-
if "pdfs" not in st.session_state:
|
14 |
-
st.session_state.pdfs = []
|
15 |
-
|
16 |
-
url = st.text_input("Enter a website link")
|
17 |
-
|
18 |
-
if "websites" not in st.session_state:
|
19 |
-
st.session_state.websites = []
|
20 |
-
|
21 |
-
submit_button = st.form_submit_button(label='Submit')
|
22 |
-
|
23 |
-
if submit_button:
|
24 |
-
if url:
|
25 |
-
st.session_state.websites.append(url)
|
26 |
-
vectorstore = vectorize(url)
|
27 |
-
retriever = vectorstore.as_retriever(search_type="similarity", search_kwargs={"k": 3})
|
28 |
-
answer = retriever.invoke("What are promises?")
|
29 |
-
for value in answer:
|
30 |
-
st.write(value.page_content)
|
31 |
-
|
32 |
-
if uploaded_files:
|
33 |
-
st.session_state.pdfs.append(uploaded_files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|