Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,9 @@ st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
|
| 37 |
set_background('./15683.jpg')
|
| 38 |
|
| 39 |
if 'HuggingFace_API_Key' not in st.session_state:
|
| 40 |
-
st.session_state['HuggingFace_API_Key'] = os.
|
| 41 |
if 'Pinecone_API_Key' not in st.session_state:
|
| 42 |
-
st.session_state['Pinecone_API_Key'] = os.
|
| 43 |
|
| 44 |
st.title("π TCE.edu Chat Assistant: Your Friendly Guide to Everything TCE! π")
|
| 45 |
|
|
@@ -58,7 +58,7 @@ if load_button:
|
|
| 58 |
|
| 59 |
embeddings=create_embeddings()
|
| 60 |
st.write("π§ Model ready to understand your queries!")
|
| 61 |
-
push_to_pinecone('
|
| 62 |
st.write("π Data loaded into Pinecone for quick searching!")
|
| 63 |
|
| 64 |
st.sidebar.success("π Data successfully loaded into Pinecone!")
|
|
@@ -76,7 +76,7 @@ if submit:
|
|
| 76 |
|
| 77 |
embeddings=create_embeddings()
|
| 78 |
st.write("π§ Model ready to understand your queries!")
|
| 79 |
-
index=pull_from_pinecone('
|
| 80 |
st.write("π Database retrieval is done!")
|
| 81 |
|
| 82 |
relavant_docs=get_similar_docs(index,prompt,document_count)
|
|
|
|
| 37 |
set_background('./15683.jpg')
|
| 38 |
|
| 39 |
if 'HuggingFace_API_Key' not in st.session_state:
|
| 40 |
+
st.session_state['HuggingFace_API_Key'] = os.environ["HF_TOKEN"]
|
| 41 |
if 'Pinecone_API_Key' not in st.session_state:
|
| 42 |
+
st.session_state['Pinecone_API_Key'] = os.environ["PINECONE_API"]
|
| 43 |
|
| 44 |
st.title("π TCE.edu Chat Assistant: Your Friendly Guide to Everything TCE! π")
|
| 45 |
|
|
|
|
| 58 |
|
| 59 |
embeddings=create_embeddings()
|
| 60 |
st.write("π§ Model ready to understand your queries!")
|
| 61 |
+
push_to_pinecone(st.session_state['Pinecone_API_Key'],constants.PINECONE_ENVIRONMENT,constants.PINECONE_INDEX,embeddings,chunks_data)
|
| 62 |
st.write("π Data loaded into Pinecone for quick searching!")
|
| 63 |
|
| 64 |
st.sidebar.success("π Data successfully loaded into Pinecone!")
|
|
|
|
| 76 |
|
| 77 |
embeddings=create_embeddings()
|
| 78 |
st.write("π§ Model ready to understand your queries!")
|
| 79 |
+
index=pull_from_pinecone(st.session_state['Pinecone_API_Key'],constants.PINECONE_ENVIRONMENT,constants.PINECONE_INDEX,embeddings)
|
| 80 |
st.write("π Database retrieval is done!")
|
| 81 |
|
| 82 |
relavant_docs=get_similar_docs(index,prompt,document_count)
|