Upload Keras models or pickled files

Our current file_uplaoder is not able to upload machine learning models. Are you aware of any workaround?

model_path = st.file_uploader("Choose a h5 file", type="h5")
model = load_model(model_path)

This gets me this error:

unexpected type <class 'NoneType'> for filepath``

Any suggestions?

Hello @Abusnina,

It’s a bit odd that the error refers to a filepath that looks like it’s None but the variable is not in the snippet you provided, so I guess it’s in the load_model method…

Would you be able to provide a minimal reproducible example so we can dig into it ?