Guru-25 commited on
Commit
625431b
β€’
1 Parent(s): ccef5a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
2
  from utils import *
3
  import constants
4
 
5
- #st.set_page_config(initial_sidebar_state="collapsed")
6
  hide_streamlit_style = """
7
  <style>
8
  #MainMenu {visibility: hidden;}
@@ -19,28 +19,28 @@ if 'Pinecone_API_Key' not in st.session_state:
19
 
20
  st.title("🌐 TCE.edu Chat Assistant: Your Friendly Guide to Everything TCE! πŸš€")
21
 
22
- #st.sidebar.title("πŸ—οΈ")
23
 
24
- #load_button = st.sidebar.button("Load data to Pinecone", key="load_button")
25
 
26
- # if load_button:
27
- # if st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_API_Key']!="" :
28
 
29
- # site_data=get_website_data(constants.WEBSITE_URL)
30
- # st.write("βœ… Data fetched successfully!")
31
 
32
- # chunks_data=split_data(site_data)
33
- # st.write("βœ‚οΈ Data split into manageable parts!")
34
 
35
- # embeddings=create_embeddings()
36
- # st.write("🧠 Model ready to understand your queries!")
37
 
38
- # push_to_pinecone(st.session_state['Pinecone_API_Key'],constants.PINECONE_ENVIRONMENT,constants.PINECONE_INDEX,embeddings,chunks_data)
39
- # st.write("πŸš€ Data loaded into Pinecone for quick searching!")
40
 
41
- # st.sidebar.success("πŸŽ‰ Data successfully loaded into Pinecone!")
42
- # else:
43
- # st.sidebar.error("❌ Oops! Please provide your API keys.") */
44
 
45
  prompt = st.text_input('How can I help you today ❓',key="prompt")
46
  document_count = st.slider('Number of results to show πŸ”— - (0 LOW || 5 HIGH)', 0, 5, 2,step=1)
 
2
  from utils import *
3
  import constants
4
 
5
+ st.set_page_config(initial_sidebar_state="collapsed")
6
  hide_streamlit_style = """
7
  <style>
8
  #MainMenu {visibility: hidden;}
 
19
 
20
  st.title("🌐 TCE.edu Chat Assistant: Your Friendly Guide to Everything TCE! πŸš€")
21
 
22
+ st.sidebar.title("πŸ—οΈ")
23
 
24
+ load_button = st.sidebar.button("Load data to Pinecone", key="load_button")
25
 
26
+ if load_button:
27
+ if st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_API_Key']!="" :
28
 
29
+ site_data=get_website_data(constants.WEBSITE_URL)
30
+ st.write("βœ… Data fetched successfully!")
31
 
32
+ chunks_data=split_data(site_data)
33
+ st.write("βœ‚οΈ Data split into manageable parts!")
34
 
35
+ embeddings=create_embeddings()
36
+ st.write("🧠 Model ready to understand your queries!")
37
 
38
+ push_to_pinecone(st.session_state['Pinecone_API_Key'],constants.PINECONE_ENVIRONMENT,constants.PINECONE_INDEX,embeddings,chunks_data)
39
+ st.write("πŸš€ Data loaded into Pinecone for quick searching!")
40
 
41
+ st.sidebar.success("πŸŽ‰ Data successfully loaded into Pinecone!")
42
+ else:
43
+ st.sidebar.error("❌ Oops! Please provide your API keys.")
44
 
45
  prompt = st.text_input('How can I help you today ❓',key="prompt")
46
  document_count = st.slider('Number of results to show πŸ”— - (0 LOW || 5 HIGH)', 0, 5, 2,step=1)