binqiangliu commited on
Commit
44f4dbd
·
1 Parent(s): 8ad6053

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -138,11 +138,11 @@ with st.sidebar:
138
  st.sidebar.markdown('<span class="blue-underline">Life Enhancing with AI.</span>', unsafe_allow_html=True)
139
  try:
140
  with st.spinner("Preparing website materials for you..."):
141
- url="https://www.usinoip.com/AI3KEYS.html"
142
  #url="https://www.usinoip.com"
143
  #url_loader = WebBaseLoader([url])
144
  #urls = [ 'https://www.usinoip.com/AI3KEYS.html', 'https://www.usinoip.com/AIInsights/308.html']
145
- url_test_loader=WebBaseLoader(urls)
146
  raw_text = url_loader.load()
147
  page_content = raw_text[0].page_content
148
  page_content = str(page_content)
@@ -150,10 +150,11 @@ with st.sidebar:
150
  texts = temp_texts
151
  initial_embeddings=get_embeddings(texts)
152
  db_embeddings = torch.FloatTensor(initial_embeddings)
153
- #except Exception as e:
154
  # st.write("Unknow error.")
155
  # print("Please enter a valide URL.")
156
- # st.stop()
 
157
 
158
  if st.button('Get AI Response'):
159
  if user_question !="" and not user_question.strip().isspace() and not user_question == "" and not user_question.strip() == "" and not user_question.isspace():
 
138
  st.sidebar.markdown('<span class="blue-underline">Life Enhancing with AI.</span>', unsafe_allow_html=True)
139
  try:
140
  with st.spinner("Preparing website materials for you..."):
141
+ #url="https://www.usinoip.com/AI3KEYS.html"
142
  #url="https://www.usinoip.com"
143
  #url_loader = WebBaseLoader([url])
144
  #urls = [ 'https://www.usinoip.com/AI3KEYS.html', 'https://www.usinoip.com/AIInsights/308.html']
145
+ url_loader=WebBaseLoader(["https://www.usinoip.com/AI3KEYS.html"])
146
  raw_text = url_loader.load()
147
  page_content = raw_text[0].page_content
148
  page_content = str(page_content)
 
150
  texts = temp_texts
151
  initial_embeddings=get_embeddings(texts)
152
  db_embeddings = torch.FloatTensor(initial_embeddings)
153
+ except Exception as e:
154
  # st.write("Unknow error.")
155
  # print("Please enter a valide URL.")
156
+ # st.stop()
157
+ pass
158
 
159
  if st.button('Get AI Response'):
160
  if user_question !="" and not user_question.strip().isspace() and not user_question == "" and not user_question.strip() == "" and not user_question.isspace():