Summary
I am building text summarizer with user feedback for validating a LLM model. However, the code below the line if st.button(“Submit”) doesn’t seem to work. Please advise how to fix the second button.
Steps to reproduce
Code snippet:
import streamlit as st
def main():
summary = None
st.title("Text Summarization")
# User input
input_text = st.text_area("Enter the text you want to summarize:", height=200)
# Summarize button
if st.button("Summarize"):
if input_text:
summary = 'This is a summary of the input text.'
# Display the summary as bullet points
st.subheader("Summary:")
st.write(summary)
else:
st.warning("Please enter text to summarize.")
if summary:
input_feedback = st.text_area("Submit feedback:", height=100)
st.write('All good until here')
if st.button("Submit"):
st.write("User feedback and summary is now saved.")
if __name__ == "__main__":
main()
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
I would like to see the text “User feedback and summary is now saved.” written after clicking the submit button.
Actual behavior:
Nothing happens after I click the Submit button