Mr-Vicky-01 commited on
Commit
25af079
1 Parent(s): b369983

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -53,10 +53,10 @@ def user_input(user_question):
53
  response = chain({"input_documents": docs, "question": user_question}, return_only_outputs=True)
54
  return response["output_text"]
55
 
56
- def response_generator(response):
57
- for word in response.split():
58
- yield word + " "
59
- time.sleep(0.05)
60
 
61
  # Streamlit app initialization
62
  st.title("Chat With PDF 📄")
@@ -77,8 +77,8 @@ with st.sidebar:
77
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
78
  if user_prompt:
79
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
80
- answer = user_input(user_prompt)
81
- response = response_generator(response=answer)
82
  st.session_state.messages.append({'role': 'assistant', "content": response})
83
 
84
  for message in st.session_state.messages:
 
53
  response = chain({"input_documents": docs, "question": user_question}, return_only_outputs=True)
54
  return response["output_text"]
55
 
56
+ # def response_generator(response):
57
+ # for word in response.split():
58
+ # yield word + " "
59
+ # time.sleep(0.05)
60
 
61
  # Streamlit app initialization
62
  st.title("Chat With PDF 📄")
 
77
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
78
  if user_prompt:
79
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
80
+ response = user_input(user_prompt)
81
+ # answer = response_generator(response)
82
  st.session_state.messages.append({'role': 'assistant', "content": response})
83
 
84
  for message in st.session_state.messages: