@wcneill @ricardocalleja
I can see I am almost a year/half year behind you but hope that if it doesn’t help you, it might someone else searching on a similar problem.
TL;DR
There is a missing creation of the btn_run object but a later call to it, which fails the script samples you’ve both provided.
Separately, I also found that there is a python/pip change post Oct 2020 that affects if copy pasting from the example nb from fastai.
Detail
I’ve debugged this particular bit of code, which seems to be confusing in the fastai lesson because of the mixing of a components to do step by step checking (with #hide descriptors at the top of the cell) and the code you need to pull out to create a local voila.
What I can see is that the object for ‘btn_run’ hasn’t been created prior to the function in either of your code samples and its called later on, causing a execution stop.
I.e. there is no classify button object for btn_run.on_click(on_click_classify) to act upon and therefore there is a execution error and the error message.
I also don’t see a modifier for the btn_upload to carry this out either, like Jeremy must of done in the demonstration in Lesson 3 video (i think lesson 3?!).
Adding:
btn_run = widgets.Button(description=‘Classify’)
results in a working program.
For those also copy pasting, there is a python change that will have voila fail when rendering the .ipynb. I would avoid or comment out
!pip install -Uqq fastbook
or add the modifier to test, as the way pip deals with dependencies has changed recently >Oct 2020 and this will result in a failure of the nbconvert script that voila relies on for conversion.
I found by "repip’ing’:
pip install voila
resolved to the correct version of nbconvert and allowed a successful render of the program to a local server.
I’ve tested at binder and this works also.
There are a few odd behavioral bugs but they aren’t functional, so I chose to ignore them with toy code.
I’ve found using jupyterlabs is tricky and needs a couple of extensions to be added, so things such as GCP are difficult, and it was easier to resolve on local machine with a copy of jupyter notebooks in a virtualenv.
HTH
Steve