shukdevdatta123 commited on
Commit
c158890
·
verified ·
1 Parent(s): 3d7184d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,9 +45,10 @@ with col1:
45
  with col2:
46
  # Refresh button to reset the user input and output
47
  if st.button("Refresh"):
 
48
  st.session_state.user_input = ""
49
  st.session_state.prediction = None
50
- st.rerun() # Use st.rerun() instead of st.experimental_rerun()
51
 
52
  # Display the prediction result
53
  if st.session_state.prediction:
@@ -55,4 +56,3 @@ if st.session_state.prediction:
55
  st.write(f"Text: {prediction['text']}")
56
  st.write(f"Prediction: {prediction['label']}")
57
  # st.write(f"Confidence: {prediction['confidence']}")
58
-
 
45
  with col2:
46
  # Refresh button to reset the user input and output
47
  if st.button("Refresh"):
48
+ # Clear both user input and prediction output
49
  st.session_state.user_input = ""
50
  st.session_state.prediction = None
51
+ st.rerun() # Refresh the app
52
 
53
  # Display the prediction result
54
  if st.session_state.prediction:
 
56
  st.write(f"Text: {prediction['text']}")
57
  st.write(f"Prediction: {prediction['label']}")
58
  # st.write(f"Confidence: {prediction['confidence']}")