Commit ·
8e17490
1
Parent(s): 15e4fce
update app.py
Browse files32 unmodified lines33343536373839404142434445464732 unmodified linesprompt = st.text_input("Please ask your question here:")# Button to submit questionif st.button("Submit"):if prompt.strip():# Display user message in chat message containerst.markdown("<b style='color:Red;'>User:</b> {}".format(prompt), unsafe_allow_html=True)# Generate responseresult = pipe(prompt)#, max_length=100, num_return_sequences=1)# Display bot response in chat message containerst.markdown("<b style='color:Green;'>Bot:</b> {}".format(result[0]['generated_text']), unsafe_allow_html=True)32 unmodified lines333435363738394041424344454632 unmodified linesprompt = st.text_input("Please ask your question here:")if prompt := st.chat_input("Please ask your question here:"):# Display user message in chat message containerst.chat_message("user").markdown("<b style='color:Red;'>"+prompt+"</b>", unsafe_allow_html=True)# Add user message to chat historyst.session_state.query = promptst.session_state.messages.append({"role": "user", "content": prompt})# Generate responseresult = pipe(prompt)#, max_length=100, num_return_sequences=1)
app.py+8-9