I trained an image classification model that I productionized using FastAPI and I want to deploy it via Heroku.
My model is large (859 MB), hence I added it to my repo via GitHub LFS. However Heroku does not support GitHubs LFS by default and even if it did my model would basically saturate the slug size which is limited at 500MB.
The solution that I came up with is the request the model at the begining of the app like the following, then use to classify the image:
urll = 'https://github.com/nainiayoub/paintings-artist-classifier/releases/download/v1.0.0/artists_classifier.h5'
filename_model = urll.split('/')[-1]
urllib.request.urlretrieve(urll, filename_model)
model_file = filename_model
My API was successfuly deployed however it returns
503 Undocumented Error: Service Unavailable.
Which likely means that my model was not loaded.
At this ppoint I am stuck and I am not sure how to proceed, do you have any idea or an alternative solution to deploy my large model?