Skip to content

Commit

Permalink
Changed st.script_runner.StopException to st.StopException as this is…
Browse files Browse the repository at this point in the history
… the way to access this exception on the newest version of the library.
  • Loading branch information
ZeroCool940711 committed Aug 24, 2022
1 parent 9da97e8 commit 7adecea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diffusion_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def generate_image(
frames = []

try:
# Try block catches st.script_runner.StopExecution, no need of a dedicated stop button
# Try block catches st.StopExecution, no need of a dedicated stop button
# Reason is st.form is meant to be self-contained either within sidebar, or in main body
# The way the form is implemented in this app splits the form across both regions
# This is intended to prevent the model settings from crowding the main body
Expand Down Expand Up @@ -181,7 +181,7 @@ def generate_image(

status_text.text("Done!") # End of run

except st.script_runner.StopException as e:
except st.StopException as e:
# Dump output to dashboard
print(f"Received Streamlit StopException")
status_text.text("Execution interruped, dumping outputs ...")
Expand Down

0 comments on commit 7adecea

Please sign in to comment.