Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions notebooks/atai_2026/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,43 @@
},
"outputs": [],
"source": [
"# Install ollama.\n",
"!curl -fsSL https://ollama.com/install.sh | sh > /dev/null\n",
"!nohup ollama serve >/dev/null 2>&1 &\n",
"\n",
"# Download the granite4:3b weights.\n",
"!ollama pull granite4:latest\n",
"# One-time setup: install Mellea, then restart the runtime. This MUST be a\n",
"# separate cell that ends by restarting, and it must run before ollama or any\n",
"# import. Installing mellea upgrades Colab's preinstalled pillow (11.x, which\n",
"# predates `_Ink`) to a newer pillow (12.x), but this kernel already imported the\n",
"# old PIL and keeps serving its cached PIL._typing (which lacks `_Ink`) even after\n",
"# pip swaps the new files onto disk -- so docling would fail with\n",
"# 'ImportError: cannot import name _Ink from PIL._typing'. The disk is already\n",
"# correct after install; only the running kernel is stale, so restarting it is the\n",
"# whole fix. After the restart, run the next cell.\n",
"\n",
"# install Mellea.\n",
"!uv pip install \"mellea[hf,docling,sandbox,tools]\"\n",
"\n",
"# install additional dependencies.\n",
"!uv pip install matplotlib \"omegaconf>=2.3\" \"ipywidgets>=8.1.8\"\n",
"\n",
"# Restart the runtime so the kernel reloads the freshly installed pillow.\n",
"import IPython # noqa: E402\n",
"IPython.Application.instance().kernel.do_shutdown(True)\n"
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"# Setup (run after the restart above). ollama, model weights, supporting files, and\n",
"# display niceties all live here rather than in the install cell, because that cell\n",
"# restarts the runtime -- which would kill the ollama server and discard the display\n",
"# hooks and logger config.\n",
"\n",
"# Install and start ollama.\n",
"!curl -fsSL https://ollama.com/install.sh | sh > /dev/null\n",
"!nohup ollama serve >/dev/null 2>&1 &\n",
"\n",
"# Download the granite4:3b weights.\n",
"!ollama pull granite4:latest\n",
"\n",
"# Get supporting files.\n",
"!wget https://nfulton.org/atai26.tar.gz\n",
"!tar xvfz atai26.tar.gz\n",
Expand Down
36 changes: 30 additions & 6 deletions notebooks/icml_2026/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,43 @@
},
"outputs": [],
"source": [
"# Install ollama. Uncomment if you don't have ollama installed / running.\n",
"# !curl -fsSL https://ollama.com/install.sh | sh > /dev/null\n",
"# !nohup ollama serve >/dev/null 2>&1 &\n",
"\n",
"# Download the granite4.1:3b weights.\n",
"!ollama pull granite4.1:3b\n",
"# One-time setup: install Mellea, then restart the runtime. This MUST be a\n",
"# separate cell that ends by restarting, and it must run before ollama or any\n",
"# import. Installing mellea upgrades Colab's preinstalled pillow (11.x, which\n",
"# predates `_Ink`) to a newer pillow (12.x), but this kernel already imported the\n",
"# old PIL and keeps serving its cached PIL._typing (which lacks `_Ink`) even after\n",
"# pip swaps the new files onto disk -- so docling would fail with\n",
"# 'ImportError: cannot import name _Ink from PIL._typing'. The disk is already\n",
"# correct after install; only the running kernel is stale, so restarting it is the\n",
"# whole fix. After the restart, run the next cell.\n",
"\n",
"# install Mellea.\n",
"!uv pip install \"mellea[hf,docling,sandbox,tools]==0.6.0\"\n",
"\n",
"# install additional dependencies.\n",
"!uv pip install matplotlib \"omegaconf>=2.3\" \"ipywidgets>=8.1.8\"\n",
"\n",
"# Restart the runtime so the kernel reloads the freshly installed pillow.\n",
"import IPython # noqa: E402\n",
"IPython.Application.instance().kernel.do_shutdown(True)\n"
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"# Setup (run after the restart above). ollama, model weights, supporting files, and\n",
"# display niceties all live here rather than in the install cell, because that cell\n",
"# restarts the runtime -- which would kill the ollama server and discard the display\n",
"# hooks and logger config.\n",
"\n",
"# Install ollama. Uncomment if you don't have ollama installed / running.\n",
"# !curl -fsSL https://ollama.com/install.sh | sh > /dev/null\n",
"# !nohup ollama serve >/dev/null 2>&1 &\n",
"\n",
"# Download the granite4.1:3b weights.\n",
"!ollama pull granite4.1:3b\n",
"\n",
"# Get supporting files.\n",
"!curl -L https://raw.githubusercontent.com/generative-computing/mellea-tutorials/refs/heads/main/notebooks/icml_2026/construction_docs.tar.gz | tar -xzf -\n",
"\n",
Expand Down
36 changes: 30 additions & 6 deletions notebooks/orlando_2025/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,41 @@
},
"outputs": [],
"source": [
"# Install ollama.\n",
"# One-time setup: install Mellea, then restart the runtime. This MUST be a\n",
"# separate cell that ends by restarting, and it must run before ollama or any\n",
"# import. Installing mellea upgrades Colab's preinstalled pillow (11.x, which\n",
"# predates `_Ink`) to a newer pillow (12.x), but this kernel already imported the\n",
"# old PIL and keeps serving its cached PIL._typing (which lacks `_Ink`) even after\n",
"# pip swaps the new files onto disk -- so docling would fail with\n",
"# 'ImportError: cannot import name _Ink from PIL._typing'. The disk is already\n",
"# correct after install; only the running kernel is stale, so restarting it is the\n",
"# whole fix. After the restart, run the next cell.\n",
"\n",
"# install Mellea.\n",
"!uv pip install mellea[all] -q\n",
"\n",
"# Restart the runtime so the kernel reloads the freshly installed pillow.\n",
"import IPython # noqa: E402\n",
"IPython.Application.instance().kernel.do_shutdown(True)\n"
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"# Setup (run after the restart above). ollama, model weights, the docling warm-up,\n",
"# and display niceties all live here rather than in the install cell, because that\n",
"# cell restarts the runtime -- which would kill the ollama server, discard the\n",
"# display hooks, and run docling against the stale (pre-restart) pillow.\n",
"\n",
"# Install and start ollama.\n",
"!curl -fsSL https://ollama.com/install.sh | sh > /dev/null\n",
"!nohup ollama serve >/dev/null 2>&1 &\n",
"\n",
"\n",
"# Download model weights for the Granite 4 and Llama 3.2 models.\n",
"!ollama pull ibm/granite4:micro\n",
"!ollama pull llama3.2:3b\n",
"\n",
"# install Mellea.\n",
"!uv pip install mellea[all] -q\n",
"\n",
"# Run docling once to download model weights.\n",
"from mellea.stdlib.components.docs.richdocument import RichDocument\n",
"rd = RichDocument.from_document_file(\"https://arxiv.org/pdf/1906.04043\")\n",
Expand Down Expand Up @@ -586,4 +610,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}