SaileshSivan commited on
Commit
57202e4
·
1 Parent(s): f2ce899

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -80,17 +80,17 @@ with st.form(key='my_form'):
80
  unsafe_allow_html=True
81
  )
82
 
83
- submit = st.form_submit_button("Submit", key="submit")
84
-
85
-
86
- # If the "Ask" button is clicked
87
- if submit:
88
- # Display loading message while processing
89
- with st.spinner("Analyzing..."):
90
- response = get_chatmodel_response(input_question)
91
-
92
- if response is not None:
93
- # st.subheader("Here you go,")
94
- st.write(response)
95
- else:
96
- st.subheader("Error: Unable to get response. Please try again later.")
 
80
  unsafe_allow_html=True
81
  )
82
 
83
+ submit = st.form_submit_button("Submit", on_click=get_chatmodel_response, args=(input_question,))
84
+
85
+
86
+ # If the "Ask" button is clicked
87
+ if submit:
88
+ # Display loading message while processing
89
+ with st.spinner("Analyzing..."):
90
+ response = get_chatmodel_response(input_question)
91
+
92
+ if response is not None:
93
+ # st.subheader("Here you go,")
94
+ st.write(response)
95
+ else:
96
+ st.subheader("Error: Unable to get response. Please try again later.")