I have created a st.selectbox to select a pickle file for a model.
I created 5 variables to choose from, each variable representing a url to the pickle file.
Disaster, Economey, Health, Industry, Poverty = 'src/tasks/task-5-web-app-deployment/pckls/disaster.pkl', 'src/tasks/task-5-web-app-deployment/pckls/dweg.pkl', 'src/tasks/task-5-web-app-deployment/pckls/health.pkl', 'src/tasks/task-5-web-app-deployment/pckls/industry_II.pkl', 'src/tasks/task-5-web-app-deployment/pckls/poverty.pkl'
I then created the selectbox
option = st.selectbox( 'Please Select the Pillar', options=( Disaster, Economey, Health, Industry, Poverty ), help='Here are 5 pillars that can influence the vulnerability of a City')
This is then loaded into the model
with open(option, 'rb') as file: kmeans = pkl.load(file)
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Explain what you expect to happen when you run the code above.
Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.
I then use the variable name to select the correct .csv file for the model and predictions.
I would like to be able to change what is seen in the options box to reflect the variable names not the variable values.