How to specify version for dependencies so that each one is compatible and stays within a size limit?
Till now, what I have learned is that it is a trial and error process.
And the best solution is to look for projects that have already done this using a working combination of libraries.
I used this requirements.txt file, which works fine:
gunicorn
flask
numpy
https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
torchvision==0.2.2
fastai==1.0.52
jupyter

The web app works perfectly and the permitted size is not exceeded.
Although Heroku's size limit is 500 MB, they have a soft limit of 300 MB. These libraries, their dependencies, and the model file together exceed that resulting in a slightly longer response time.