iShare commited on
Commit
7f37dd8
·
1 Parent(s): 4eff231

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -49,18 +49,18 @@ def chat():
49
  print(user_query)
50
  if user_query !="" and not user_query.strip().isspace() and not user_query == "" and not user_query.strip() == "" and not user_query.isspace():
51
  try:
52
- #loader = WebBaseLoader(user_query)
53
- loader = WebBaseLoader("https://zhuanlan.zhihu.com/p/627439522")
54
  #print(loader)
55
  print(user_query)
56
- with st.spinner("AI Thinking...Please wait a while to Cheers!"):
57
- docs = loader.load()
58
- result=chain.run(docs)
59
- print(user_query)
60
- print("AI Summarization: "+result)
61
- #st.write("AI Summarization:")
62
- #st.write(result)
63
- return jsonify({'response': result})
64
  except Exception as e:
65
  #st.write("Wrong URL or URL not parsable.")
66
  err_msg="Wrong URL or URL not parsable."
 
49
  print(user_query)
50
  if user_query !="" and not user_query.strip().isspace() and not user_query == "" and not user_query.strip() == "" and not user_query.isspace():
51
  try:
52
+ ##loader = WebBaseLoader(user_query)
53
+ #loader = WebBaseLoader("https://zhuanlan.zhihu.com/p/627439522")
54
  #print(loader)
55
  print(user_query)
56
+ #with st.spinner("AI Thinking...Please wait a while to Cheers!"):
57
+ docs = loader.load()
58
+ result=chain.run(docs)
59
+ print(user_query)
60
+ print("AI Summarization: "+result)
61
+ #st.write("AI Summarization:")
62
+ #st.write(result)
63
+ return jsonify({'response': result})
64
  except Exception as e:
65
  #st.write("Wrong URL or URL not parsable.")
66
  err_msg="Wrong URL or URL not parsable."