Forráskód Böngészése

Add colab-related changes

Artem Chumachenko 2 éve
szülő
commit
d9e82b6408
1 módosított fájl, 24 hozzáadás és 3 törlés
  1. 24 3
      examples/prompt-tuning-personachat.ipynb

+ 24 - 3
examples/prompt-tuning-personachat.ipynb

@@ -24,6 +24,22 @@
     "First, we have to prepare all dependencies."
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "8ec7e625",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# uncomment this block for colab usage\n",
+    "# git clone https://github.com/bigscience-workshop/petals\n",
+    "# !pip install petals/requirements.txt\n",
+    "# !pip install datasets wandb\n",
+    "\n",
+    "# if you use cpu-only setup on colab, please uncomment this block\n",
+    "# !rm -r /usr/local/cuda/lib64"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -33,7 +49,7 @@
    "source": [
     "import os\n",
     "import sys\n",
-    "sys.path.insert(0, \"..\")\n",
+    "sys.path.insert(0, \"..\") # for colab change to sys.path.insert(0, './petals/')\n",
     " \n",
     "import torch\n",
     "import transformers\n",
@@ -285,7 +301,7 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 3 (ipykernel)",
+   "display_name": "Python 3.8.10 64-bit",
    "language": "python",
    "name": "python3"
   },
@@ -299,7 +315,12 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.8.12"
+   "version": "3.8.10"
+  },
+  "vscode": {
+   "interpreter": {
+    "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
+   }
   }
  },
  "nbformat": 4,