Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -436,7 +436,7 @@ if selected_app == "4) Create Chatbot":
|
|
| 436 |
|
| 437 |
st.sidebar.markdown('''This is a chatbot to help you learn more about {organization_name}''')
|
| 438 |
|
| 439 |
-
domain = st.sidebar.selectbox("Select a topic", {{[
|
| 440 |
|
| 441 |
special_threshold = 0.3
|
| 442 |
|
|
@@ -448,11 +448,9 @@ if selected_app == "4) Create Chatbot":
|
|
| 448 |
st.session_state.messages = []
|
| 449 |
st.session_state.curr_domain = ""
|
| 450 |
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
####
|
| 455 |
-
##
|
| 456 |
|
| 457 |
initial_input = "Tell me about {organization_name}"
|
| 458 |
|
|
@@ -482,17 +480,13 @@ if selected_app == "4) Create Chatbot":
|
|
| 482 |
if "curr_domain" not in st.session_state:
|
| 483 |
st.session_state.curr_domain = ""
|
| 484 |
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
###
|
| 489 |
-
###
|
| 490 |
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
###
|
| 495 |
-
###
|
| 496 |
|
| 497 |
# Embed and store the first N supports for this demo
|
| 498 |
with st.spinner("Loading, please be patient with us ... 🙏"):
|
|
|
|
| 436 |
|
| 437 |
st.sidebar.markdown('''This is a chatbot to help you learn more about {organization_name}''')
|
| 438 |
|
| 439 |
+
domain = st.sidebar.selectbox("Select a topic", {{[d["name"] for d in domain_info]}})
|
| 440 |
|
| 441 |
special_threshold = 0.3
|
| 442 |
|
|
|
|
| 448 |
st.session_state.messages = []
|
| 449 |
st.session_state.curr_domain = ""
|
| 450 |
|
| 451 |
+
for d in domain_info:
|
| 452 |
+
if domain == d['name']:
|
| 453 |
+
dataset = load_dataset(d['link'])
|
|
|
|
|
|
|
| 454 |
|
| 455 |
initial_input = "Tell me about {organization_name}"
|
| 456 |
|
|
|
|
| 480 |
if "curr_domain" not in st.session_state:
|
| 481 |
st.session_state.curr_domain = ""
|
| 482 |
|
| 483 |
+
init_messages = {{}}
|
| 484 |
+
for d in domain_info:
|
| 485 |
+
init_messages[d['name']] = d['purpose']
|
|
|
|
|
|
|
| 486 |
|
| 487 |
+
chatbot_instructions = {{}}
|
| 488 |
+
for d in domain_info:
|
| 489 |
+
chatbot_instructions[d['name']] = d['instructions']
|
|
|
|
|
|
|
| 490 |
|
| 491 |
# Embed and store the first N supports for this demo
|
| 492 |
with st.spinner("Loading, please be patient with us ... 🙏"):
|