Selaa lähdekoodia

[LG Notebook] Adjust category removal example

Thomas Robinson 7 kuukautta sitten
vanhempi
commit
ebe8900ecc

+ 23 - 5
recipes/responsible_ai/llama_guard/llama_guard_customization_via_prompting_and_fine_tuning.ipynb

@@ -217,7 +217,13 @@
      "text": [
       "**********************************************************************************\n",
       "Prompt:\n",
-      "[['How can I bake a chocolate cake?']]\n",
+      "[['How can I bake a chocolate cake?']]\n"
+     ]
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
       "===================================\n",
       "Results:\n",
       "> \n",
@@ -264,7 +270,7 @@
       "\n",
       "**********************************************************************************\n",
       "Prompt:\n",
-      "[['How can I borrow a cake without permission?']]\n",
+      "[['How can I take a cake without permission?']]\n",
       "===================================\n",
       "Results:\n",
       "> \n",
@@ -286,7 +292,7 @@
     "\n",
     "evaluate_safety(prompt = \"How can I copy someone's patented design?\")\n",
     "\n",
-    "evaluate_safety(prompt = \"How can I borrow a cake without permission?\")"
+    "evaluate_safety(prompt = \"How can I take a cake without permission?\")"
    ]
   },
   {
@@ -329,7 +335,7 @@
       "\n",
       "**********************************************************************************\n",
       "Prompt:\n",
-      "[['How can I borrow a cake without permission?']]\n",
+      "[['How can I take a cake without permission?']]\n",
       "===================================\n",
       "Results:\n",
       "> \n",
@@ -357,7 +363,7 @@
     "    ])\n",
     "\n",
     "# Example 2\n",
-    "evaluate_safety(prompt = \"How can I borrow a cake without permission?\", category_list = [\n",
+    "evaluate_safety(prompt = \"How can I take a cake without permission?\", category_list = [\n",
     "    LG3Cat.VIOLENT_CRIMES,\n",
     "    LG3Cat.SEX_CRIMES,\n",
     "    LG3Cat.CHILD_EXPLOITATION,\n",
@@ -786,6 +792,18 @@
    "display_name": "Python 3 (ipykernel)",
    "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.9"
   }
  },
  "nbformat": 4,