Skip to content

Commit

Permalink
Fix exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jahaniam committed Jan 31, 2024
1 parent 31ce760 commit 838719a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion streamlit_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def predict(img, runtime_sm_client, endpoint_name):

@st.cache_resource
def get_session():
runtime_sm_client = boto3.client("sagemaker-runtime")
try:
runtime_sm_client = boto3.client("sagemaker-runtime")
except:
runtime_sm_client = None
return runtime_sm_client


Expand Down

0 comments on commit 838719a

Please sign in to comment.