@Thisara_Shyamalee This looks like a bug in how Streamlit Cloud clones Git LFS objects. I’ve raised this issue internally.
In the meantime, here’s a workaround:
- Right after your imports, include the following snippet to download your
.h5
model withcurl
to Streamlit Cloud:
import subprocess
if not os.path.isfile('model.h5'):
subprocess.run(['curl --output model.h5 "https://media.githubusercontent.com/media/ShyamaleeT/glaucocare/main/sep_5.h5"'], shell=True)
- Replace
model = tf.keras.models.load_model('sep_5.h5', compile=False)
with:
model = tf.keras.models.load_model('model.h5', compile=False)
-
Don’t delete or rename the
sep_5.h5
file from your repo, as we’re using its url to download your model in Step 1
Once you make the above changes, your app should successfully load your model!