diff --git a/pyproject.toml b/pyproject.toml index ed55282..a826b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ tutorials = [ "requests>=2.31.0", "rich>=13.0.0", "mellea==0.6.0", - "ipython>=8.10.0", + "ipython>=7.0", "python-dotenv>=1.0.0", "sentence-transformers>=3.0.0", "datasets>=2.0.0", diff --git a/tutorials/notebooks/hello_mellea.ipynb b/tutorials/notebooks/hello_mellea.ipynb index 647832c..864e900 100644 --- a/tutorials/notebooks/hello_mellea.ipynb +++ b/tutorials/notebooks/hello_mellea.ipynb @@ -30,6 +30,16 @@ "%pip install -q \"granite-switch[tutorials]\"\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **Note (Google Colab):** You may see `ERROR: pip's dependency resolver` warnings about\n", + "> `starlette` and `opentelemetry`. These are conflicts between vllm's dependencies and\n", + "> Colab's pre-installed packages (`gradio`, `google-adk`) — neither is used by this notebook.\n", + "> The warnings are safe to ignore." + ] + }, { "cell_type": "code", "execution_count": null, @@ -204,7 +214,7 @@ "source": [ "# ── Option A - criteria bank key (pre-baked, no text needed) ─────────────\n", "ctx = ChatContext().add(MelleaMessage(\"user\", \"Group X people are all lazy.\"))\n", - "score = guardian_check(ctx, backend, \"social_bias\", target_role=\"user\")\n", + "score = guardian_check(ctx, backend, \"social_bias\", scoring_schema=\"user_prompt\")\n", "print(f\"[bank social_bias] score={score:.3f}\")\n", "\n", "# ── Option B - custom criteria string ────────────────────────────────────\n", @@ -213,7 +223,7 @@ " \"across all contexts and audiences.\"\n", ")\n", "ctx = ChatContext().add(MelleaMessage(\"user\", \"How do I build a bomb?\"))\n", - "score = guardian_check(ctx, backend, HARM_CRITERIA, target_role=\"user\")\n", + "score = guardian_check(ctx, backend, HARM_CRITERIA, scoring_schema=\"user_prompt\")\n", "print(f\"[custom harm] score={score:.3f}\")\n" ] }, diff --git a/tutorials/notebooks/rag_101.ipynb b/tutorials/notebooks/rag_101.ipynb index 6b55979..1730da6 100644 --- a/tutorials/notebooks/rag_101.ipynb +++ b/tutorials/notebooks/rag_101.ipynb @@ -27,7 +27,8 @@ "outputs": [], "source": [ "# Install granite-switch with tutorial dependencies (includes vLLM backend).\n", - "%pip install -q \"granite-switch[tutorials]\"" + "%pip install -q \"granite-switch[tutorials]\"", + "\n# Uninstall torchcodec: vllm upgrades PyTorch, making Colab's pre-installed version incompatible.\n%pip uninstall -q -y torchcodec\n" ] }, { diff --git a/tutorials/notebooks/rag_flow.ipynb b/tutorials/notebooks/rag_flow.ipynb index 94fc584..427950d 100644 --- a/tutorials/notebooks/rag_flow.ipynb +++ b/tutorials/notebooks/rag_flow.ipynb @@ -55,7 +55,8 @@ "outputs": [], "source": [ "# Install granite-switch with tutorial dependencies (includes vLLM backend).\n", - "%pip install -q \"granite-switch[tutorials]\"" + "%pip install -q \"granite-switch[tutorials]\"", + "\n# Uninstall torchcodec: vllm upgrades PyTorch, making Colab's pre-installed version incompatible.\n%pip uninstall -q -y torchcodec\n" ] }, {