Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,7 +74,7 @@ def create_knowledge_base(data):
|
|
| 74 |
# Convert the data into a list of strings
|
| 75 |
documents = []
|
| 76 |
for grant in data['grants']:
|
| 77 |
-
doc = f"Grant Name: {grant['grant_name']}n\Grant Value: {grant['grant_value']}\nFunding Organisation: {grant['funding_organisation']}\nDue Date: {grant['due_date']}\nEligible Countries: {grant['eligible_countries']}\nEligibility Conditions: {grant['eligibility_criteria']}"
|
| 78 |
documents.append(doc)
|
| 79 |
|
| 80 |
# Split the documents into chunks
|
|
@@ -94,6 +94,7 @@ def create_knowledge_base(data):
|
|
| 94 |
|
| 95 |
def main():
|
| 96 |
st.sidebar.title("Quantilytix Grant Scraper")
|
|
|
|
| 97 |
|
| 98 |
url = st.sidebar.text_input("Enter URL")
|
| 99 |
|
|
@@ -141,7 +142,7 @@ def main():
|
|
| 141 |
st.session_state.chat_interface_active = True
|
| 142 |
|
| 143 |
if "chat_interface_active" in st.session_state and st.session_state.chat_interface_active:
|
| 144 |
-
st.
|
| 145 |
|
| 146 |
query = st.text_input("Ask a question about the grants:", key="chat_input")
|
| 147 |
if query:
|
|
|
|
| 74 |
# Convert the data into a list of strings
|
| 75 |
documents = []
|
| 76 |
for grant in data['grants']:
|
| 77 |
+
doc = f"Grant Name: {grant['grant_name']}n\Grant Value: {grant['grant_value']}\nFunding Organisation: {grant['funding_organisation']}\nGrant Description: {grant['grant_description']}\nDue Date: {grant['due_date']}\nEligible Countries: {grant['eligible_countries']}\nEligibility Conditions: {grant['eligibility_criteria']}"
|
| 78 |
documents.append(doc)
|
| 79 |
|
| 80 |
# Split the documents into chunks
|
|
|
|
| 94 |
|
| 95 |
def main():
|
| 96 |
st.sidebar.title("Quantilytix Grant Scraper")
|
| 97 |
+
st.sidebar.image("logoqb.jpeg", use_column_width=True)
|
| 98 |
|
| 99 |
url = st.sidebar.text_input("Enter URL")
|
| 100 |
|
|
|
|
| 142 |
st.session_state.chat_interface_active = True
|
| 143 |
|
| 144 |
if "chat_interface_active" in st.session_state and st.session_state.chat_interface_active:
|
| 145 |
+
st.heading("Chat Interface Loaded. Start asking questions about the grants!")
|
| 146 |
|
| 147 |
query = st.text_input("Ask a question about the grants:", key="chat_input")
|
| 148 |
if query:
|