Starter project to deploy a trained fast.ai models to the web using Render.
Guide for production deployment to Render is here.
This is the original project.
Prepare your starter app:
- Fork this repository.
- Sign up for a Render account.
Deploy it:
- Create a new Web Service on Render Dashboard and use the repo you created above. You will need to grant Render permission to access your repo in this step.
- On the deployment screen, pick a name for your service and use Docker for the Environment. The URL will be created using this service name. The service name can be changed if necessary, but the URL initially created can’t be edited.
- Click Save Web Service. That’s it! Your service will begin building and should be live in a few minutes at the URL displayed in your Render dashboard. You can follow its progress in the deploy logs.
Modify you repository:
- Share link
on
bears_trained_model.pkl
or other Pickle file in your Google Drive. Anyone with the link or anyone in the Internet can view it. - Create the downloadable (not shareable) direct link. Use direct link generator for Google Drive, Dropbox or Onedrive.
- Edit the file server.py inside the
app
directory and update themodel_file_url
variable with the URL copied above. Updateexport_file_name
tobears_trained_model.pkl
. Updateclasses
if you have other classes. - Push a change into GitHub. Render integrates with your GitHub repo and automatically builds and deploys changes every time you push a change.
- Wait several minutes (now it is 6 min) for the application to deploy.
- Test out this web-site with bear images!
You can test your changes locally by installing Docker and using the following command:
docker build -t fastai-v3 . && docker run --rm -it -p 5000:5000 fastai-v3
Please use Render's fast.ai forum thread for questions and support.