Munwar92 commited on
Commit
d59637c
·
verified ·
1 Parent(s): 5b2840d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -76,16 +76,17 @@ def main():
76
  if mode == "Text":
77
  user_input = st.text_input("Ask me anything:")
78
  if user_input:
79
- url = "https://www.sbbusba.edu.pk/" # Example URL
80
- web_content = scrape_website(url)
81
- relevant_data = search(user_input, [web_content])
 
 
 
 
 
 
 
82
 
83
- if relevant_data and isinstance(relevant_data[0], str):
84
- response = generate_response(f"Based on the content of the website: {relevant_data[0]}")
85
- st.write("Bot: " + response)
86
- text_to_speech(response)
87
- else:
88
- st.write("Bot: Sorry, I couldn't find any relevant data.")
89
 
90
 
91
  elif mode == "Voice":
 
76
  if mode == "Text":
77
  user_input = st.text_input("Ask me anything:")
78
  if user_input:
79
+ url = "https://www.sbbusba.edu.pk/" # Example URL
80
+ web_content = scrape_website(url)
81
+ relevant_data = search(user_input, [web_content])
82
+
83
+ if relevant_data and isinstance(relevant_data[0], str):
84
+ response = generate_response(f"Based on the content of the website: {relevant_data[0]}")
85
+ st.write("Bot: " + response)
86
+ text_to_speech(response)
87
+ else:
88
+ st.write("Bot: Sorry, I couldn't find any relevant data.")
89
 
 
 
 
 
 
 
90
 
91
 
92
  elif mode == "Voice":