2 years ago
#39586

ViksaaSkool
Top2Vec model (>100MB) doesn't load on Heroku
I have a Python Flask app on Heroku. There are 3 Top2Vec trained models that I'm trying to load as global variables in app.py
, before first request:
@app.before_first_request
def models():
global model1
global model2
global model3
model1, model2, model3 = load_models()
load_models()
method, just the standard load call defined in the Top2Vec library:
def load_models():
return [Top2Vec.load(MODEL1_PATH), Top2Vec.load(MODEL2_PATH),
Top2Vec.load(MODEL3_PATH)]
where MODEL1_PATH
, MODEL2_PATH
, MODEL3_PATH
are the absolute path to the model file.
When I try to open the app localy, everything works fine, but when I open the hosted web app, I get:
All three models are files larger than 100MB and are uploaded with git lfs
and I suspect, this might play a role in the error I'm getting. Any ideas why I'm getting this and how to fix it? Am I making some rookie mistake?
python
heroku
joblib
0 Answers
Your Answer