|
7 | 7 | "provenance": [],
|
8 | 8 | "collapsed_sections": [],
|
9 | 9 | "machine_shape": "hm",
|
10 |
| - "authorship_tag": "ABX9TyP9nxnN9wm2/27BTNCCEz3j", |
| 10 | + "authorship_tag": "ABX9TyN1uhCmEDAoq5zrKwioAmfi", |
11 | 11 | "include_colab_link": true
|
12 | 12 | },
|
13 | 13 | "kernelspec": {
|
|
2778 | 2778 | "source": [
|
2779 | 2779 | "## Inference with GPT-J-6B\n",
|
2780 | 2780 | "\n",
|
2781 |
| - "In this notebook, we are going to perform inference (i.e. generating new text) with EleutherAI's [GPT-J-6B model](https://github.com/kingoflolz/mesh-transformer-jax/), which is a 6 billion parameter GPT model trained on [The Pile](https://arxiv.org/abs/2101.00027), a huge publicly available text dataset, also collected by EleutherAI. The model itself was trained on TPUv3s using JAX and Haiku (the latter being a neural net library on top of JAX).\n", |
| 2781 | + "In this notebook, we are going to perform inference (i.e. generate new text) with EleutherAI's [GPT-J-6B model](https://github.com/kingoflolz/mesh-transformer-jax/), which is a 6 billion parameter GPT model trained on [The Pile](https://arxiv.org/abs/2101.00027), a huge publicly available text dataset, also collected by EleutherAI. The model itself was trained on TPUv3s using JAX and Haiku (the latter being a neural net library on top of JAX).\n", |
2782 | 2782 | "\n",
|
2783 |
| - "EleutherAI itself is a group of AI researchers doing awesome AI research (and making everything publicly available and free to use). You can check out their website [here](https://www.eleuther.ai/).\n", |
2784 |
| - "\n", |
2785 |
| - "EleutherAI also created [GPT-Neo](), which are smaller GPT variants (with 125 million, 1.3 billion and 2.7 billion parameters respectively). Check out their models on the hub [here](https://huggingface.co/EleutherAI).\n", |
| 2783 | + "[EleutherAI](https://www.eleuther.ai/) itself is a group of AI researchers doing awesome AI research (and making everything publicly available and free to use). They've also created [GPT-Neo](https://github.com/EleutherAI/gpt-neo), which are smaller GPT variants (with 125 million, 1.3 billion and 2.7 billion parameters respectively). Check out their models on the hub [here](https://huggingface.co/EleutherAI).\n", |
2786 | 2784 | "\n",
|
2787 | 2785 | "NOTE: this notebook requires at least 12.1GB of CPU memory. I'm personally using Colab Pro to run it (and set runtime to GPU - high RAM usage). Unfortunately, the free version of Colab only provides 10 GB of RAM, which isn't enough.\n",
|
2788 | 2786 | "\n",
|
|
2829 | 2827 | "source": [
|
2830 | 2828 | "## Load model and tokenizer\n",
|
2831 | 2829 | "\n",
|
2832 |
| - "First, we load the model from the hub. We select the \"float16\" revision, which means that all parameters are stored using 16 bits, rather than the default float32 ones (which require more RAM memory). We also set `low_cpu_mem_usage` to `True` (which was introduced in [this PR](https://github.com/huggingface/transformers/pull/13466)), in order to only load the model once into CPU memory.\n", |
| 2830 | + "First, we load the model from the hub. We select the \"float16\" revision, which means that all parameters are stored using 16 bits, rather than the default float32 ones (which require twice as much RAM memory). We also set `low_cpu_mem_usage` to `True` (which was introduced in [this PR](https://github.com/huggingface/transformers/pull/13466)), in order to only load the model once into CPU memory.\n", |
2833 | 2831 | "\n",
|
2834 | 2832 | "Next, we move the model to the GPU and load the corresponding tokenizer, which we'll use to prepare text for the model."
|
2835 | 2833 | ]
|
|
0 commit comments