awslabs / sagemaker-explaining-credit-decisions

Amazon SageMaker Solution for explaining credit decisions.
Apache License 2.0
95 stars 28 forks source link

Cell fails in 5_dashboard #5

Open juliensimon opened 3 years ago

juliensimon commented 3 years ago

Calling get_notebook_name() fails with KeyError: 'SolutionPrefix'

port = 8501
url = get_dashboard_url(port)
!echo Dashboard URL: {url}
!(cd ../containers/dashboard/src && streamlit run app.py --server.port {port})

KeyError Traceback (most recent call last)

in 1 port = 8501 ----> 2 url = get_dashboard_url(port) 3 get_ipython().system('echo Dashboard URL: {url}') 4 get_ipython().system('(cd ../containers/dashboard/src && streamlit run app.py --server.port {port})') in get_dashboard_url(port) 8 9 def get_dashboard_url(port): ---> 10 notebook_name = get_notebook_name() 11 region_name = sagemaker.Session().boto_region_name 12 return f"https://{notebook_name}.notebook.{region_name}.sagemaker.aws/proxy/{port}/" in get_notebook_name() 2 with open('/opt/ml/metadata/resource-metadata.json') as openfile: 3 data = json.load(openfile) ----> 4 notebook_name = data['SolutionPrefix'] 5 return notebook_name 6 #return 'sm-soln-explaining-credit-decisions-notebook' KeyError: 'SolutionPrefix'
thomelane commented 3 years ago

Seems there was an overzealous find and replace. It should be ResourceName. I'll change this back.