{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "end_time": "2024-01-31T13:17:32.853174Z", "start_time": "2024-01-31T13:17:26.201882Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: pip in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (23.3.2)\r\n", "Requirement already satisfied: gradio in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (4.16.0)\r\n", "Requirement already satisfied: aiofiles<24.0,>=22.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (23.2.1)\r\n", "Requirement already satisfied: altair<6.0,>=4.2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (5.2.0)\r\n", "Requirement already satisfied: fastapi in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.109.0)\r\n", "Requirement already satisfied: ffmpy in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.3.1)\r\n", "Requirement already satisfied: gradio-client==0.8.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.8.1)\r\n", "Requirement already satisfied: httpx in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.26.0)\r\n", "Requirement already satisfied: huggingface-hub>=0.19.3 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.20.3)\r\n", "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (6.1.1)\r\n", "Requirement already satisfied: jinja2<4.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (3.1.2)\r\n", "Requirement already satisfied: markupsafe~=2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (2.1.3)\r\n", "Requirement already satisfied: matplotlib~=3.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (3.8.2)\r\n", "Requirement already satisfied: numpy~=1.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (1.26.3)\r\n", "Requirement already satisfied: orjson~=3.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (3.9.12)\r\n", "Requirement already satisfied: packaging in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (23.1)\r\n", "Requirement already satisfied: pandas<3.0,>=1.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (2.2.0)\r\n", "Requirement already satisfied: pillow<11.0,>=8.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (10.2.0)\r\n", "Requirement already satisfied: pydantic>=2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (2.6.0)\r\n", "Requirement already satisfied: pydub in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.25.1)\r\n", "Requirement already satisfied: python-multipart in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.0.6)\r\n", "Requirement already satisfied: pyyaml<7.0,>=5.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (6.0.1)\r\n", "Requirement already satisfied: ruff>=0.1.7 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.1.15)\r\n", "Requirement already satisfied: semantic-version~=2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (2.10.0)\r\n", "Requirement already satisfied: tomlkit==0.12.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.12.0)\r\n", "Requirement already satisfied: typer<1.0,>=0.9 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.9.0)\r\n", "Requirement already satisfied: typing-extensions~=4.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (4.9.0)\r\n", "Requirement already satisfied: uvicorn>=0.14.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio) (0.27.0.post1)\r\n", "Requirement already satisfied: fsspec in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio-client==0.8.1->gradio) (2023.12.2)\r\n", "Requirement already satisfied: websockets<12.0,>=10.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from gradio-client==0.8.1->gradio) (11.0.3)\r\n", "Requirement already satisfied: jsonschema>=3.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.2)\r\n", "Requirement already satisfied: toolz in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.1)\r\n", "Requirement already satisfied: filelock in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\r\n", "Requirement already satisfied: requests in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\r\n", "Requirement already satisfied: tqdm>=4.42.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\r\n", "Requirement already satisfied: contourpy>=1.0.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\r\n", "Requirement already satisfied: cycler>=0.10 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\r\n", "Requirement already satisfied: fonttools>=4.22.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (4.47.2)\r\n", "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\r\n", "Requirement already satisfied: pyparsing>=2.3.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\r\n", "Requirement already satisfied: python-dateutil>=2.7 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\r\n", "Requirement already satisfied: pytz>=2020.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\r\n", "Requirement already satisfied: tzdata>=2022.7 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from pandas<3.0,>=1.0->gradio) (2023.4)\r\n", "Requirement already satisfied: annotated-types>=0.4.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from pydantic>=2.0->gradio) (0.6.0)\r\n", "Requirement already satisfied: pydantic-core==2.16.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from pydantic>=2.0->gradio) (2.16.1)\r\n", "Requirement already satisfied: click<9.0.0,>=7.1.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from typer<1.0,>=0.9->typer[all]<1.0,>=0.9->gradio) (8.1.7)\r\n", "Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\r\n", "Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\r\n", "Requirement already satisfied: rich<14.0.0,>=10.11.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\r\n", "Requirement already satisfied: h11>=0.8 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from uvicorn>=0.14.0->gradio) (0.14.0)\r\n", "Requirement already satisfied: starlette<0.36.0,>=0.35.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from fastapi->gradio) (0.35.1)\r\n", "Requirement already satisfied: anyio in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from httpx->gradio) (4.2.0)\r\n", "Requirement already satisfied: certifi in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from httpx->gradio) (2023.11.17)\r\n", "Requirement already satisfied: httpcore==1.* in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from httpx->gradio) (1.0.2)\r\n", "Requirement already satisfied: idna in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from httpx->gradio) (3.4)\r\n", "Requirement already satisfied: sniffio in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from httpx->gradio) (1.3.0)\r\n", "Requirement already satisfied: attrs>=22.2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\r\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\r\n", "Requirement already satisfied: referencing>=0.28.4 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\r\n", "Requirement already satisfied: rpds-py>=0.7.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\r\n", "Requirement already satisfied: six>=1.5 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\r\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\r\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.15.1)\r\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.0.4)\r\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (1.26.18)\r\n", "Requirement already satisfied: mdurl~=0.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\r\n" ] } ], "source": [ "!pip install -Uqq fastai\n", "!pip install --upgrade pip\n", "!pip install gradio" ] }, { "cell_type": "code", "outputs": [], "source": [ "#|default_exp app" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:32.866781Z", "start_time": "2024-01-31T13:17:32.853554Z" } }, "id": "131cfda07ddd85ac", "execution_count": 3 }, { "cell_type": "code", "outputs": [], "source": [ "#|export\n", "from fastai.vision.all import *\n", "import gradio as gr\n", "\n", "def is_grizzly(x): return x[0].isupper()" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:48.186611Z", "start_time": "2024-01-31T13:17:32.857277Z" } }, "id": "69aefb3580da341f", "execution_count": 4 }, { "cell_type": "code", "outputs": [], "source": [ "#|export\n", "learn = load_learner('export.pkl')" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:48.208712Z", "start_time": "2024-01-31T13:17:48.188919Z" } }, "id": "65a607022a16cd59", "execution_count": 5 }, { "cell_type": "code", "outputs": [], "source": [ "#|export\n", "categories = ('black', 'grizzly', 'teddy')\n", "\n", "def classify_image(img):\n", " pred,pred_idx,probs = learn.predict(img)\n", " return dict(zip(categories, map(float, probs)))" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:48.218289Z", "start_time": "2024-01-31T13:17:48.210181Z" } }, "id": "5d718a1ff473d36f", "execution_count": 6 }, { "cell_type": "code", "outputs": [], "source": [ "#|export\n", "image = gr.Image(width=224, height=224)\n", "label = gr.Label()\n", "examples = [\n", " ['images/grizzly.png'],\n", " ['images/black.png'],\n", " ['images/teddy.png']\n", "]" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:48.218664Z", "start_time": "2024-01-31T13:17:48.212792Z" } }, "id": "f3eb492b280e1353", "execution_count": 7 }, { "cell_type": "code", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7860\n", "\n", "To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/plain": "", "text/html": "
" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": "" }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#|export\n", "gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples).launch()" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:48.327783Z", "start_time": "2024-01-31T13:17:48.217419Z" } }, "id": "2f43279622f0bad4", "execution_count": 8 }, { "cell_type": "code", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting nbdev\r\n", " Using cached nbdev-2.3.13-py3-none-any.whl.metadata (10 kB)\r\n", "Requirement already satisfied: ipywidgets<=8.0.4 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from nbdev) (8.0.4)\r\n", "Requirement already satisfied: fastcore>=1.5.27 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from nbdev) (1.5.29)\r\n", "Collecting execnb>=0.1.4 (from nbdev)\r\n", " Using cached execnb-0.1.5-py3-none-any.whl (13 kB)\r\n", "Collecting astunparse (from nbdev)\r\n", " Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)\r\n", "Collecting ghapi>=1.0.3 (from nbdev)\r\n", " Using cached ghapi-1.0.4-py3-none-any.whl.metadata (13 kB)\r\n", "Collecting watchdog (from nbdev)\r\n", " Using cached watchdog-3.0.0-cp311-cp311-macosx_11_0_arm64.whl (91 kB)\r\n", "Requirement already satisfied: asttokens in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from nbdev) (2.0.5)\r\n", "Requirement already satisfied: PyYAML in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from nbdev) (6.0.1)\r\n", "Requirement already satisfied: ipython in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from execnb>=0.1.4->nbdev) (8.20.0)\r\n", "Requirement already satisfied: pip in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from fastcore>=1.5.27->nbdev) (23.3.2)\r\n", "Requirement already satisfied: packaging in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from fastcore>=1.5.27->nbdev) (23.1)\r\n", "Requirement already satisfied: ipykernel>=4.5.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipywidgets<=8.0.4->nbdev) (6.28.0)\r\n", "Requirement already satisfied: traitlets>=4.3.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipywidgets<=8.0.4->nbdev) (5.7.1)\r\n", "Requirement already satisfied: widgetsnbextension~=4.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipywidgets<=8.0.4->nbdev) (4.0.5)\r\n", "Requirement already satisfied: jupyterlab-widgets~=3.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipywidgets<=8.0.4->nbdev) (3.0.9)\r\n", "Requirement already satisfied: six in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from asttokens->nbdev) (1.16.0)\r\n", "Requirement already satisfied: wheel<1.0,>=0.23.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from astunparse->nbdev) (0.41.2)\r\n", "Requirement already satisfied: appnope in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.2)\r\n", "Requirement already satisfied: comm>=0.1.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.2)\r\n", "Requirement already satisfied: debugpy>=1.6.5 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.6.7)\r\n", "Requirement already satisfied: jupyter-client>=6.1.12 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (8.6.0)\r\n", "Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.5.0)\r\n", "Requirement already satisfied: matplotlib-inline>=0.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.6)\r\n", "Requirement already satisfied: nest-asyncio in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.5.6)\r\n", "Requirement already satisfied: psutil in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.9.0)\r\n", "Requirement already satisfied: pyzmq>=24 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (25.1.2)\r\n", "Requirement already satisfied: tornado>=6.1 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (6.3.3)\r\n", "Requirement already satisfied: decorator in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (5.1.1)\r\n", "Requirement already satisfied: jedi>=0.16 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.18.1)\r\n", "Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (3.0.43)\r\n", "Requirement already satisfied: pygments>=2.4.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (2.15.1)\r\n", "Requirement already satisfied: stack-data in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.2.0)\r\n", "Requirement already satisfied: pexpect>4.3 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from ipython->execnb>=0.1.4->nbdev) (4.8.0)\r\n", "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jedi>=0.16->ipython->execnb>=0.1.4->nbdev) (0.8.3)\r\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (2.8.2)\r\n", "Requirement already satisfied: platformdirs>=2.5 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (3.10.0)\r\n", "Requirement already satisfied: ptyprocess>=0.5 in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from pexpect>4.3->ipython->execnb>=0.1.4->nbdev) (0.7.0)\r\n", "Requirement already satisfied: wcwidth in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython->execnb>=0.1.4->nbdev) (0.2.5)\r\n", "Requirement already satisfied: executing in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (0.8.3)\r\n", "Requirement already satisfied: pure-eval in /Users/ellen/miniconda3/envs/minima/lib/python3.11/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (0.2.2)\r\n", "Using cached nbdev-2.3.13-py3-none-any.whl (66 kB)\r\n", "Using cached ghapi-1.0.4-py3-none-any.whl (58 kB)\r\n", "Installing collected packages: watchdog, astunparse, ghapi, execnb, nbdev\r\n", "Successfully installed astunparse-1.6.3 execnb-0.1.5 ghapi-1.0.4 nbdev-2.3.13 watchdog-3.0.0\r\n" ] } ], "source": [ "!pip install nbdev" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:50.062123Z", "start_time": "2024-01-31T13:17:48.339494Z" } }, "id": "876b397b80c82dd", "execution_count": 9 }, { "cell_type": "code", "outputs": [], "source": [ "import nbdev" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:50.149378Z", "start_time": "2024-01-31T13:17:50.064748Z" } }, "id": "a6999db4bdd9fc11", "execution_count": 10 }, { "cell_type": "code", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Export successful.\n" ] } ], "source": [ "nbdev.export.nb_export('app.ipynb', './')\n", "print('Export successful.')" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:50.154880Z", "start_time": "2024-01-31T13:17:50.149782Z" } }, "id": "4b9a6222130c5222", "execution_count": 11 }, { "cell_type": "code", "outputs": [], "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-01-31T13:17:50.160011Z", "start_time": "2024-01-31T13:17:50.155060Z" } }, "id": "a163ce5fbeb88c1f", "execution_count": 11 } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }