Spaces:
Runtime error
Runtime error
Commit
Β·
24b629d
1
Parent(s):
eb8b7d0
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,8 +18,8 @@ st.title('π€ AI Assistance For Website')
|
|
| 18 |
st.sidebar.title("πποΈ")
|
| 19 |
st.session_state['Website_URL']= st.sidebar.text_input("Input the Website URL you want to Query against?")
|
| 20 |
st.session_state['HuggingFace_API_Key']= st.sidebar.text_input("What's your HuggingFace API key?",type="password")
|
| 21 |
-
st.session_state['Pinecone_ENV']= st.sidebar.text_input("What's your Pinecone Environment?")
|
| 22 |
st.session_state['Pinecone_Index']= st.sidebar.text_input("What's your Pinecone Index?")
|
|
|
|
| 23 |
st.session_state['Pinecone_API_Key']= st.sidebar.text_input("What's your Pinecone API key?",type="password")
|
| 24 |
|
| 25 |
load_button = st.sidebar.button("Load data to Pinecone", key="load_button")
|
|
@@ -30,7 +30,7 @@ if load_button:
|
|
| 30 |
if st.session_state['Website_URL'] !="" and st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_ENV'] !="" and st.session_state['Pinecone_API_Key']!="" :
|
| 31 |
|
| 32 |
#Fetch data from site
|
| 33 |
-
site_data=get_website_data(
|
| 34 |
st.write("Data pull done...")
|
| 35 |
|
| 36 |
#Split data into chunks
|
|
@@ -60,14 +60,14 @@ submit = st.button("Search")
|
|
| 60 |
|
| 61 |
if submit:
|
| 62 |
#Proceed only if API keys are provided
|
| 63 |
-
if st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_API_Key']!="" :
|
| 64 |
|
| 65 |
#Creating embeddings instance
|
| 66 |
embeddings=create_embeddings()
|
| 67 |
st.write("Embeddings instance creation done...")
|
| 68 |
|
| 69 |
#Pull index data from Pinecone
|
| 70 |
-
index=pull_from_pinecone(st.session_state['Pinecone_API_Key'],
|
| 71 |
st.write("Pinecone index retrieval done...")
|
| 72 |
|
| 73 |
#Fetch relavant documents from Pinecone index
|
|
|
|
| 18 |
st.sidebar.title("πποΈ")
|
| 19 |
st.session_state['Website_URL']= st.sidebar.text_input("Input the Website URL you want to Query against?")
|
| 20 |
st.session_state['HuggingFace_API_Key']= st.sidebar.text_input("What's your HuggingFace API key?",type="password")
|
|
|
|
| 21 |
st.session_state['Pinecone_Index']= st.sidebar.text_input("What's your Pinecone Index?")
|
| 22 |
+
st.session_state['Pinecone_ENV']= st.sidebar.text_input("What's your Pinecone Environment?")
|
| 23 |
st.session_state['Pinecone_API_Key']= st.sidebar.text_input("What's your Pinecone API key?",type="password")
|
| 24 |
|
| 25 |
load_button = st.sidebar.button("Load data to Pinecone", key="load_button")
|
|
|
|
| 30 |
if st.session_state['Website_URL'] !="" and st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_ENV'] !="" and st.session_state['Pinecone_API_Key']!="" :
|
| 31 |
|
| 32 |
#Fetch data from site
|
| 33 |
+
site_data=get_website_data(st.session_state['Website_URL'])
|
| 34 |
st.write("Data pull done...")
|
| 35 |
|
| 36 |
#Split data into chunks
|
|
|
|
| 60 |
|
| 61 |
if submit:
|
| 62 |
#Proceed only if API keys are provided
|
| 63 |
+
if st.session_state['Website_URL'] !="" and st.session_state['HuggingFace_API_Key'] !="" and st.session_state['Pinecone_ENV'] !="" and st.session_state['Pinecone_API_Key']!="" :
|
| 64 |
|
| 65 |
#Creating embeddings instance
|
| 66 |
embeddings=create_embeddings()
|
| 67 |
st.write("Embeddings instance creation done...")
|
| 68 |
|
| 69 |
#Pull index data from Pinecone
|
| 70 |
+
index=pull_from_pinecone(st.session_state['Pinecone_API_Key'],st.session_state['Pinecone_ENV'],st.session_state['Pinecone_Index'],embeddings)
|
| 71 |
st.write("Pinecone index retrieval done...")
|
| 72 |
|
| 73 |
#Fetch relavant documents from Pinecone index
|