Skip to content

Latest commit

 

History

History

notebook

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

notebook

A simple example using a Jupyter Notebook with Cog

Usage

First, make sure you've got the latest version of Cog installed.

Build the image:

cog build

Run the Jupyter Notebook server with Cog:

cog run -p 8888 --debug jupyter notebook --allow-root --ip=0.0.0.0 --NotebookApp.token=mytoken

Copy the notebook URL to your browser (you can change the mytoken to your preferred token or have it autogenerated):

http://127.0.0.1:8888/?token=mytoken

Save any changes you make to your notebook, then export it as a Python script:

jupyter nbconvert --to script my_notebook.ipynb # creates my_notebook.py

Now you can run predictions on the model:

cog predict -i name=Alice