diff --git a/notebooks/example/data/data.csv b/notebooks/example/data/data.csv new file mode 100644 index 00000000..126a03bb --- /dev/null +++ b/notebooks/example/data/data.csv @@ -0,0 +1,3 @@ +row,text,label +1,some example data,1 +2,some more data,0 diff --git a/notebooks/example/example.ipynb b/notebooks/example/example.ipynb index de199a60..0d8e1fcb 100644 --- a/notebooks/example/example.ipynb +++ b/notebooks/example/example.ipynb @@ -48,11 +48,12 @@ } ], "source": [ - "# uncomment below cell to install required packages if running in Google Colab.\n", - "!pip install transformers\n", - "# if needed you can git clone the repo\n", - "!git clone https://github.com/andrewm4894/Open-Assistant.git\n", - "!cd Open-Assistant/notebooks/example" + "# uncomment and run below lines to set up if running in colab\n", + "#%%bash\n", + "# git clone https://github.com/andrewm4894/Open-Assistant.git\n", + "# git checkout example-notebook\n", + "# cd Open-Assistant/notebooks/example\n", + "# pip install -r requirements.txt" ] }, { @@ -87,6 +88,7 @@ ], "source": [ "# import required packages\n", + "import pandas as pd\n", "from transformers import pipeline" ] }, @@ -114,25 +116,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Do cool stuff here" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Binder" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We want to have every notebook folder be easily runnable on Binder. This means that every notebook folder should have a `requirements.txt` file that contains all the dependencies for the notebook. This is so that Binder can install all the dependencies for the notebook when it is run.\n", - "\n", - "If you have more complex dependencies then there are a number of ways to add additional configuration files in the folder that Binder will use to install the dependencies. See the [Binder documentation](https://mybinder.readthedocs.io/en/latest/config_files.html) for more information." + "# Do cool stuff here\n", + "df = pd.read_csv(\"data/data.csv\")" ] } ], diff --git a/notebooks/example/requirements.txt b/notebooks/example/requirements.txt new file mode 100644 index 00000000..976a2b1f --- /dev/null +++ b/notebooks/example/requirements.txt @@ -0,0 +1 @@ +transformers