Skip to content

Commit

Permalink
Prompt-tuning notebooks: suggest to use a smaller model for faster pr…
Browse files Browse the repository at this point in the history
…ototyping (#234)
  • Loading branch information
borzunov authored Jan 24, 2023
1 parent d4c687d commit 5d7395e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ You can also host [BLOOMZ](https://huggingface.co/bigscience/bloomz), a version
Basic tutorials:

- Getting started: [tutorial](https://colab.research.google.com/drive/1Ervk6HPNS6AYVr3xVdQnY5a-TjjmLCdQ?usp=sharing)
- Fine-tune BLOOM to be a personified chatbot: [tutorial](https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-personachat.ipynb)
- Fine-tune BLOOM for text semantic classification: [tutorial](https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-sst2.ipynb)
- Prompt-tune BLOOM to create a personified chatbot: [tutorial](https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-personachat.ipynb)
- Prompt-tune BLOOM for text semantic classification: [tutorial](https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-sst2.ipynb)

Example apps built with Petals:

Expand Down
16 changes: 13 additions & 3 deletions examples/prompt-tuning-personachat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,26 @@
"metadata": {},
"outputs": [],
"source": [
"MODEL_NAME = \"bigscience/bloom-petals\" # select model you like\n",
"# Choose a model you'd like to prompt-tune. We recommend starting with\n",
"# the smaller 7.1B version of BLOOM (bigscience/bloom-7b1-petals) for faster prototyping.\n",
"# Once your code is ready, you can switch to full-scale\n",
"# 176B-parameter BLOOM (bigscience/bloom-petals) or BLOOMZ (bigscience/bloomz-petals).\n",
"MODEL_NAME = \"bigscience/bloom-7b1-petals\"\n",
"\n",
"# Choose a prompt-tuning mode ('ptune' or 'deep_ptune').\n",
"# The latter fine-tunes separate prefixes for each transformer block,\n",
"# so prompt-tuning will take more time but yield better results.\n",
"# See this paper for details of how it works: https://arxiv.org/pdf/2110.07602.pdf\n",
"TUNING_MODE = 'ptune'\n",
"\n",
"NUM_PREFIX_TOKENS = 16\n",
"DEVICE = 'cuda'\n",
"BATCH_SIZE = 8\n",
"LR = 1e-2\n",
"WEIGHT_DECAY = 0.0\n",
"NUM_SAMPLES = 1000\n",
"SEED = 42\n",
"MODEL_MAX_LENGTH = 256\n",
"TUNING_MODE = 'ptune' # choose between ['ptune', 'deep_ptune'] "
"MODEL_MAX_LENGTH = 256"
]
},
{
Expand Down
16 changes: 13 additions & 3 deletions examples/prompt-tuning-sst2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,26 @@
"metadata": {},
"outputs": [],
"source": [
"MODEL_NAME = \"bigscience/bloom-petals\" # select model you like\n",
"# Choose a model you'd like to prompt-tune. We recommend starting with\n",
"# the smaller 7.1B version of BLOOM (bigscience/bloom-7b1-petals) for faster prototyping.\n",
"# Once your code is ready, you can switch to full-scale\n",
"# 176B-parameter BLOOM (bigscience/bloom-petals) or BLOOMZ (bigscience/bloomz-petals).\n",
"MODEL_NAME = \"bigscience/bloom-7b1-petals\"\n",
"\n",
"# Choose a prompt-tuning mode ('ptune' or 'deep_ptune').\n",
"# The latter fine-tunes separate prefixes for each transformer block,\n",
"# so prompt-tuning will take more time but yield better results.\n",
"# See this paper for details of how it works: https://arxiv.org/pdf/2110.07602.pdf\n",
"TUNING_MODE = 'ptune'\n",
"\n",
"NUM_PREFIX_TOKENS = 16\n",
"DEVICE = 'cuda'\n",
"BATCH_SIZE = 16\n",
"LR = 1e-2\n",
"WEIGHT_DECAY = 0.0\n",
"NUM_EPOCHS = 3\n",
"SEED = 42\n",
"MODEL_MAX_LENGTH = 64\n",
"TUNING_MODE = 'ptune' # choose between ['ptune', 'deep_ptune'] "
"MODEL_MAX_LENGTH = 64"
]
},
{
Expand Down

0 comments on commit 5d7395e

Please sign in to comment.