Upload 3 files to your repo: a. bears_classifier.iypnb (your own notebook or you can download from here) b. export.pkl ( It will be a large file. If it is >25MB, uploading through github is not allowed. Use the method shown in this video) c. requirements.txt (download from here)
After this your repo should look like this:
Open https://mybinder.org/ . Copy your repo URL in ‘GitHub repository name or URL’ and ‘/voila/render/bear_classifier.ipynb’ in ‘URL to open (optional)’ and change ‘File’ option to ‘URL’.
After this, it should look like this:
Press ‘Launch’. Should take some time for the first time. It launches faster next time.
If at Step 2, you are getting errors like ‘404: Not found’ or ‘There was an error when executing cell [4]. Please run Voilà with --debug to see the error message.’ then do the following:
Method-2:
Same as Step 1 above
Open https://mybinder.org/ . Copy your repo URL in ‘GitHub repository name or URL’ and leave other fields empty and press Launch.
Thank you! this really helped too!! I cloned my own repo to include the big file with terminal.
However… now I am receiving an error from voila now that I try to access deployed version, and it also seems that gihub repo of the bear-classifier is buggy. Have you looked into it?
I just deployed mine. I cloned the main repo and replaced the export.pkl with my own, since I had changed the main notebook and did penguins instead of bears. All other changes were cosmetic. Worked like a charm!
Thanks for this tutorial. I have tried both the methods but still my deployment isn’t happening. I tried the seconf method after doing the first one but at both times, it gives me this error.
Solved this. The issue was that I was not having the repo structure mentioned above. My repo had folder within which the entire code was residing. I changed that by moving it out of the folder and keeping it in the root and it worked.
I have put in a pull request to the main fastai/bear_voila repository in the hope that people like @ruta.zem and @Algorant can get past the issues they faced. The pull request shows the changes needed in requirements.txt to use the old (released) export.pkl file:
To see it working I also put it on Binder - Binder
When I deployed the first time it gave me some error basically saying it couldn’t connect to the server or whatever, there was some info on the web about fixing it but in the end what worked was Hello IT have you tried switching it off and on again so I just repeated the process and it ended up working. Magic!
Getting the correct link to give others to display the website via voila. I’ve read a short blogpost where I basically used their way of creating the link and then it ended up working.
This is the structure of the public link: https://mybinder.org/v2/gh/AllBecomesGood/bears/main?urlpath=/voila/render/BearClassifier_to_Voila.ipynb
So basically the part before /voila/render was new to me: main?urlpath=, also keep in mind I had to change from master to main as Github renamed the branch stuff.