02 Creating app with voila Google collab or Jupyter Notebook

Hi there,

So far I have run the notebooks on Google Collab as here free GPU service is provided. Now in notebook 2 at ‘Turning Your Notebook into a Real App’ Jeremy explains how to apply Voila by replacing the word ’ notebook’ to ’ voila’ in the webbrowser url
image

According to some topics I found that Voila is not available for google Collab, is this correct?

So instead of via Google Collab I run Voila via Jupyter Notebook. I tried to upload two example scripts by putting them on the local jupyter notebook folder and then push them to github, as suggested this topic .

  1. install and run everything locally on my machine (worked without a problem)
  2. upload the code to GitHub
  3. run it on binder
C:\Users\jorri\fastbook\clean\Github

image

But I run into an error when I try to upload these .ipynb files to github via the windows terminal.

I googled this error and tried to use the http link instead of the ssh link from Github, but this does not help me any further.

Does anybody have tips how to continue?

Thank you, Jorrit

There seems to be a way to run Voila on Google Colab using ngork, but it requires some setup and I haven’t tried it [1].

This seems like an issue with Git setup. If you are new to this (my experience is limited as well), I would suggest create a new project on Github and try uploading your project files directly using GitHub web UI. Once uploaded, clone the project back to local machine (files that are >25MB still need to be uploaded via command line [2]).

[1] https://towardsdatascience.com/quickly-share-ml-webapps-from-google-colab-using-ngrok-for-free-ae899ca2661a
[2] Adding a file to a repository - GitHub Docs

Thank you for sharing the links @manju-dev very helpfull and I managed to upload the files to my github repository.

These jupiter notebooks I pushed to Github as an example to see if I can visualise them in binder.

I follow the instructions from the 02_production notebook.

step 1:
image

Step 2,3,4,5 and 6:

Result:
image

I really don’t understand what I am doing wrong. Can anyone please help me?

I see few issues. Your project folder should include:

  • A pickle file (export.pkl file - the model that you have saved to disk). That’s why your notebook is throwing an error. So upload that too.
  • A requirements.txt file to help binder build the container image. You can refer to it here in this repository. Take the file and update them with your versions of the library.
  • In binder, you should be pointing to the bear_classifier.ipynb file in the URL to open field.

Try these and let’s see if it works. If it doesn’t keep posting the error messages. These are small issues but you can do it :slight_smile:

Hi Manju-dev,

Thank you so much for the help. I did all your suggested changes so now my repository looks similar the example repository. I only created an animal detector instead of a bear detector but its basically the same pickle file (and I assume also the same requirements.txt) as shown in the example. I still get the same error when trying out different URLS

If I try using the url from the github page? → /blob/master/animal_classifier.ipynb
image
image

If I try the url from the jupyter notebook

and change the word ’ notebook’ to ’ voila’ I also get an error.

image

How to specify the URL?

Jorrit, I believe you are dealing with the same issues covered in this thread: Inconsistent versions of Voila, nbconvert and nbdev - #13 by alex.larrimore