From 056a0f9f1c1bfdd5226d201170ac87185313c88a Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Sat, 7 Jan 2023 23:20:04 +0000 Subject: [PATCH] initial binder example --- notebooks/example/README.md | 6 ++ notebooks/example/example.ipynb | 119 +++++++++++++++++++++++++++++ notebooks/example/requirements.txt | 1 + 3 files changed, 126 insertions(+) create mode 100644 notebooks/example/README.md create mode 100644 notebooks/example/example.ipynb create mode 100644 notebooks/example/requirements.txt diff --git a/notebooks/example/README.md b/notebooks/example/README.md new file mode 100644 index 00000000..e847d343 --- /dev/null +++ b/notebooks/example/README.md @@ -0,0 +1,6 @@ +# Example Notebook + +[![Binder](http://mybinder.org/badge_logo.svg)](http://mybinder.org/v2/gh/andrewm4894/Open-Assistant/blob/example-notebook/notebooks/example/) + +This folder contains an example reference notebook structure and approach for +this project. Please try and follow this structure as closely as possible. diff --git a/notebooks/example/example.ipynb b/notebooks/example/example.ipynb new file mode 100644 index 00000000..ff0472b3 --- /dev/null +++ b/notebooks/example/example.ipynb @@ -0,0 +1,119 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/andrewm4894/Open-Assistant/blob/example-notebook/notebooks/example/example.ipynb)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# uncomment below cell to install required packages if running in Google Colab.\n", + "#!pip install transformers" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example Notebook" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Try to add a markdown section to the notebook that explains what the notebook is about and what it does. This will help people understand what the notebook is for and how to use it." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# import required packages\n", + "from transformers import pipeline" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use Headings\n", + "\n", + "(it will help with link sharing to specific sections of the notebook)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Make fancy markdown cells if you want." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "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." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "3ad933181bd8a04b432d3370b9dc3b0662ad032c4dfaa4e4f1596c548f763858" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} 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