diff --git a/notebooks/example/README.md b/notebooks/example/README.md new file mode 100644 index 00000000..f33af8fc --- /dev/null +++ b/notebooks/example/README.md @@ -0,0 +1,6 @@ +# Example Notebook + +[![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) + +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/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 new file mode 100644 index 00000000..c9b873aa --- /dev/null +++ b/notebooks/example/example.ipynb @@ -0,0 +1,160 @@ +{ + "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": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# uncomment and run below lines to set up if running in colab\n", + "# !git clone https://github.com/andrewm4894/Open-Assistant.git\n", + "# %cd Open-Assistant/notebooks/example\n", + "# !pip install -r requirements.txt" + ] + }, + { + "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": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# import required packages\n", + "import pandas as pd\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": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rowtextlabel
01some example data1
12some more data0
\n", + "
" + ], + "text/plain": [ + " row text label\n", + "0 1 some example data 1\n", + "1 2 some more data 0" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Do cool stuff here\n", + "df = pd.read_csv(\"data/data.csv\")\n", + "df.head()" + ] + } + ], + "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