lm-eval-overview.ipynb 62.9 KB
Newer Older
lintangsutawika's avatar
lintangsutawika committed
1
{
2
3
4
5
6
7
8
9
10
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Qw83KAePAhaS"
      },
      "source": [
        "# Releasing LM-Evaluation-Harness v0.5.0"
      ]
lintangsutawika's avatar
lintangsutawika committed
11
    },
12
13
14
15
16
17
18
19
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Z7k2vq1iAdqr"
      },
      "source": [
        "With the vast amount of work done in the field today, it helps to have a tool that people can use easily to share their results and use to check others to ensure reported numbers are valid. The LM Evaluation Harness is one such tool the community has used extensively. We want to continue to support the community and with that in mind, we’re excited to announce a major update on the LM Evaluation Harness to further our goal for open and accessible AI research."
      ]
lintangsutawika's avatar
lintangsutawika committed
20
    },
21
22
23
24
25
26
27
28
29
30
31
32
33
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "0gDoM0AJAvEc"
      },
      "source": [
        "Our refactor stems from our beliefs of the following that we think are best practices\n",
        "\n",
        "1.   Never Copy Results from Other Papers\n",
        "2.   Always share your exact prompts\n",
        "3.   Always provide model outputs\n",
        "4.   Qualitatively review a small batch of outputs before running evaluation jobs at scale\n"
      ]
lintangsutawika's avatar
lintangsutawika committed
34
    },
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "nnwsOpjda_YW"
      },
      "source": [
        "In this notebook we will be going through a short tutorial on how things work."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "zAov81vTbL2K"
      },
      "source": [
        "## Install LM-Eval"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
lintangsutawika's avatar
lintangsutawika committed
59
60
61
62
63
64
65
        },
        "id": "8hiosGzq_qZg",
        "outputId": "c6fe3ead-d9ef-489a-8b13-0424e1b26cb4"
      },
      "outputs": [
        {
          "name": "stdout",
66
          "output_type": "stream",
lintangsutawika's avatar
lintangsutawika committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
          "text": [
            "Collecting git+https://github.com/EleutherAI/lm-evaluation-harness.git@big-refactor\n",
            "  Cloning https://github.com/EleutherAI/lm-evaluation-harness.git (to revision big-refactor) to /tmp/pip-req-build-l2xli32o\n",
            "  Running command git clone --filter=blob:none --quiet https://github.com/EleutherAI/lm-evaluation-harness.git /tmp/pip-req-build-l2xli32o\n",
            "  Running command git checkout -b big-refactor --track origin/big-refactor\n",
            "  Switched to a new branch 'big-refactor'\n",
            "  Branch 'big-refactor' set up to track remote branch 'big-refactor' from 'origin'.\n",
            "  Resolved https://github.com/EleutherAI/lm-evaluation-harness.git to commit 30936bc7c6e03c41e1f0d45b68a02b0f39e399f2\n",
            "  Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
            "  Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
            "  Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "Collecting accelerate>=0.21.0 (from lm-eval==1.0.0)\n",
            "  Downloading accelerate-0.24.1-py3-none-any.whl (261 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m261.4/261.4 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting evaluate (from lm-eval==1.0.0)\n",
            "  Downloading evaluate-0.4.1-py3-none-any.whl (84 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m84.1/84.1 kB\u001b[0m \u001b[31m9.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting datasets>=2.0.0 (from lm-eval==1.0.0)\n",
            "  Downloading datasets-2.15.0-py3-none-any.whl (521 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m521.2/521.2 kB\u001b[0m \u001b[31m9.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting jsonlines (from lm-eval==1.0.0)\n",
            "  Downloading jsonlines-4.0.0-py3-none-any.whl (8.7 kB)\n",
            "Requirement already satisfied: numexpr in /usr/local/lib/python3.10/dist-packages (from lm-eval==1.0.0) (2.8.7)\n",
            "Collecting peft>=0.2.0 (from lm-eval==1.0.0)\n",
            "  Downloading peft-0.6.2-py3-none-any.whl (174 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m174.7/174.7 kB\u001b[0m \u001b[31m22.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting pybind11>=2.6.2 (from lm-eval==1.0.0)\n",
            "  Downloading pybind11-2.11.1-py3-none-any.whl (227 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m227.7/227.7 kB\u001b[0m \u001b[31m20.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting pytablewriter (from lm-eval==1.0.0)\n",
            "  Downloading pytablewriter-1.2.0-py3-none-any.whl (111 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m111.1/111.1 kB\u001b[0m \u001b[31m12.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting rouge-score>=0.0.4 (from lm-eval==1.0.0)\n",
            "  Downloading rouge_score-0.1.2.tar.gz (17 kB)\n",
            "  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "Collecting sacrebleu>=1.5.0 (from lm-eval==1.0.0)\n",
            "  Downloading sacrebleu-2.3.2-py3-none-any.whl (119 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m119.7/119.7 kB\u001b[0m \u001b[31m12.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: scikit-learn>=0.24.1 in /usr/local/lib/python3.10/dist-packages (from lm-eval==1.0.0) (1.2.2)\n",
            "Collecting sqlitedict (from lm-eval==1.0.0)\n",
            "  Downloading sqlitedict-2.1.0.tar.gz (21 kB)\n",
            "  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "Requirement already satisfied: torch>=1.8 in /usr/local/lib/python3.10/dist-packages (from lm-eval==1.0.0) (2.1.0+cu118)\n",
            "Collecting tqdm-multiprocess (from lm-eval==1.0.0)\n",
            "  Downloading tqdm_multiprocess-0.0.11-py3-none-any.whl (9.8 kB)\n",
            "Requirement already satisfied: transformers>=4.1 in /usr/local/lib/python3.10/dist-packages (from lm-eval==1.0.0) (4.35.2)\n",
            "Collecting zstandard (from lm-eval==1.0.0)\n",
            "  Downloading zstandard-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.4/5.4 MB\u001b[0m \u001b[31m30.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->lm-eval==1.0.0) (1.23.5)\n",
            "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->lm-eval==1.0.0) (23.2)\n",
            "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->lm-eval==1.0.0) (5.9.5)\n",
            "Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->lm-eval==1.0.0) (6.0.1)\n",
            "Requirement already satisfied: huggingface-hub in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->lm-eval==1.0.0) (0.19.4)\n",
            "Requirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (9.0.0)\n",
            "Collecting pyarrow-hotfix (from datasets>=2.0.0->lm-eval==1.0.0)\n",
            "  Downloading pyarrow_hotfix-0.6-py3-none-any.whl (7.9 kB)\n",
            "Collecting dill<0.3.8,>=0.3.0 (from datasets>=2.0.0->lm-eval==1.0.0)\n",
            "  Downloading dill-0.3.7-py3-none-any.whl (115 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m16.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (1.5.3)\n",
            "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (2.31.0)\n",
            "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (4.66.1)\n",
            "Requirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (3.4.1)\n",
            "Collecting multiprocess (from datasets>=2.0.0->lm-eval==1.0.0)\n",
            "  Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m17.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: fsspec[http]<=2023.10.0,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (2023.6.0)\n",
            "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets>=2.0.0->lm-eval==1.0.0) (3.8.6)\n",
            "Collecting responses<0.19 (from evaluate->lm-eval==1.0.0)\n",
            "  Downloading responses-0.18.0-py3-none-any.whl (38 kB)\n",
            "Requirement already satisfied: safetensors in /usr/local/lib/python3.10/dist-packages (from peft>=0.2.0->lm-eval==1.0.0) (0.4.0)\n",
            "Requirement already satisfied: absl-py in /usr/local/lib/python3.10/dist-packages (from rouge-score>=0.0.4->lm-eval==1.0.0) (1.4.0)\n",
            "Requirement already satisfied: nltk in /usr/local/lib/python3.10/dist-packages (from rouge-score>=0.0.4->lm-eval==1.0.0) (3.8.1)\n",
            "Requirement already satisfied: six>=1.14.0 in /usr/local/lib/python3.10/dist-packages (from rouge-score>=0.0.4->lm-eval==1.0.0) (1.16.0)\n",
            "Collecting portalocker (from sacrebleu>=1.5.0->lm-eval==1.0.0)\n",
            "  Downloading portalocker-2.8.2-py3-none-any.whl (17 kB)\n",
            "Requirement already satisfied: regex in /usr/local/lib/python3.10/dist-packages (from sacrebleu>=1.5.0->lm-eval==1.0.0) (2023.6.3)\n",
            "Requirement already satisfied: tabulate>=0.8.9 in /usr/local/lib/python3.10/dist-packages (from sacrebleu>=1.5.0->lm-eval==1.0.0) (0.9.0)\n",
            "Collecting colorama (from sacrebleu>=1.5.0->lm-eval==1.0.0)\n",
            "  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n",
            "Requirement already satisfied: lxml in /usr/local/lib/python3.10/dist-packages (from sacrebleu>=1.5.0->lm-eval==1.0.0) (4.9.3)\n",
            "Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24.1->lm-eval==1.0.0) (1.11.3)\n",
            "Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24.1->lm-eval==1.0.0) (1.3.2)\n",
            "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24.1->lm-eval==1.0.0) (3.2.0)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (3.13.1)\n",
            "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (4.5.0)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (1.12)\n",
            "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (3.2.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (3.1.2)\n",
            "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.8->lm-eval==1.0.0) (2.1.0)\n",
            "Requirement already satisfied: tokenizers<0.19,>=0.14 in /usr/local/lib/python3.10/dist-packages (from transformers>=4.1->lm-eval==1.0.0) (0.15.0)\n",
            "Requirement already satisfied: attrs>=19.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonlines->lm-eval==1.0.0) (23.1.0)\n",
            "Requirement already satisfied: setuptools>=38.3.0 in /usr/local/lib/python3.10/dist-packages (from pytablewriter->lm-eval==1.0.0) (67.7.2)\n",
            "Collecting DataProperty<2,>=1.0.1 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading DataProperty-1.0.1-py3-none-any.whl (27 kB)\n",
            "Collecting mbstrdecoder<2,>=1.0.0 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading mbstrdecoder-1.1.3-py3-none-any.whl (7.8 kB)\n",
            "Collecting pathvalidate<4,>=2.3.0 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading pathvalidate-3.2.0-py3-none-any.whl (23 kB)\n",
            "Collecting tabledata<2,>=1.3.1 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading tabledata-1.3.3-py3-none-any.whl (11 kB)\n",
            "Collecting tcolorpy<1,>=0.0.5 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading tcolorpy-0.1.4-py3-none-any.whl (7.9 kB)\n",
            "Collecting typepy[datetime]<2,>=1.3.2 (from pytablewriter->lm-eval==1.0.0)\n",
            "  Downloading typepy-1.3.2-py3-none-any.whl (31 kB)\n",
            "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (3.3.2)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (6.0.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (4.0.3)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (1.9.2)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (1.4.0)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets>=2.0.0->lm-eval==1.0.0) (1.3.1)\n",
            "Requirement already satisfied: chardet<6,>=3.0.4 in /usr/local/lib/python3.10/dist-packages (from mbstrdecoder<2,>=1.0.0->pytablewriter->lm-eval==1.0.0) (5.2.0)\n",
            "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets>=2.0.0->lm-eval==1.0.0) (3.4)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets>=2.0.0->lm-eval==1.0.0) (2.0.7)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets>=2.0.0->lm-eval==1.0.0) (2023.7.22)\n",
            "Requirement already satisfied: python-dateutil<3.0.0,>=2.8.0 in /usr/local/lib/python3.10/dist-packages (from typepy[datetime]<2,>=1.3.2->pytablewriter->lm-eval==1.0.0) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2018.9 in /usr/local/lib/python3.10/dist-packages (from typepy[datetime]<2,>=1.3.2->pytablewriter->lm-eval==1.0.0) (2023.3.post1)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.8->lm-eval==1.0.0) (2.1.3)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk->rouge-score>=0.0.4->lm-eval==1.0.0) (8.1.7)\n",
            "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.8->lm-eval==1.0.0) (1.3.0)\n",
            "Building wheels for collected packages: lm-eval, rouge-score, sqlitedict\n",
            "  Building wheel for lm-eval (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for lm-eval: filename=lm_eval-1.0.0-py3-none-any.whl size=986403 sha256=b7907b5840136fbd6ae948150ebab82776a0deb76359e59da24fbd2259de8094\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-axf286nt/wheels/17/01/26/599c0779e9858a70a73fa8a306699b5b9a868f820c225457b0\n",
            "  Building wheel for rouge-score (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for rouge-score: filename=rouge_score-0.1.2-py3-none-any.whl size=24933 sha256=8983ef5e600070817b0114ebe7ad48d72891d918ab2beea00ed6c5c437a6f713\n",
            "  Stored in directory: /root/.cache/pip/wheels/5f/dd/89/461065a73be61a532ff8599a28e9beef17985c9e9c31e541b4\n",
            "  Building wheel for sqlitedict (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for sqlitedict: filename=sqlitedict-2.1.0-py3-none-any.whl size=16863 sha256=146f7dcb0d03ca6c21a08e9d93d74d6c07cd42d0e37ddb7e922127e5ddb5e213\n",
            "  Stored in directory: /root/.cache/pip/wheels/79/d6/e7/304e0e6cb2221022c26d8161f7c23cd4f259a9e41e8bbcfabd\n",
            "Successfully built lm-eval rouge-score sqlitedict\n",
            "Installing collected packages: sqlitedict, zstandard, tcolorpy, pybind11, pyarrow-hotfix, portalocker, pathvalidate, mbstrdecoder, jsonlines, dill, colorama, typepy, tqdm-multiprocess, sacrebleu, rouge-score, responses, multiprocess, accelerate, datasets, DataProperty, tabledata, peft, evaluate, pytablewriter, lm-eval\n",
            "Successfully installed DataProperty-1.0.1 accelerate-0.24.1 colorama-0.4.6 datasets-2.15.0 dill-0.3.7 evaluate-0.4.1 jsonlines-4.0.0 lm-eval-1.0.0 mbstrdecoder-1.1.3 multiprocess-0.70.15 pathvalidate-3.2.0 peft-0.6.2 portalocker-2.8.2 pyarrow-hotfix-0.6 pybind11-2.11.1 pytablewriter-1.2.0 responses-0.18.0 rouge-score-0.1.2 sacrebleu-2.3.2 sqlitedict-2.1.0 tabledata-1.3.3 tcolorpy-0.1.4 tqdm-multiprocess-0.0.11 typepy-1.3.2 zstandard-0.22.0\n"
          ]
        }
      ],
      "source": [
        "# Install LM-Eval\n",
        "!pip install git+https://github.com/EleutherAI/lm-evaluation-harness.git@big-refactor"
      ]
    },
    {
      "cell_type": "code",
211
      "execution_count": 2,
lintangsutawika's avatar
lintangsutawika committed
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 49,
          "referenced_widgets": [
            "ff5a90d6c8884a4dbf5b70453e45bcad",
            "214bcd0301bd423b8ed691cace119137",
            "460777325dd64ecaa929021ffc9d5f3a",
            "4a50bd7b62d94f40a13a2cb7fbc0ba4b",
            "11451d297d3d4037b9fd6010d2097843",
            "164724b8d45a4adfbd44805cc16ca032",
            "18171a183d1e4dd5a4f6670e517dcc1d",
            "8c4e29d728264a5caf38dc3781a017a8",
            "52c8d0cf3e7f48959883934856331286",
            "8f62151425e345128a110b6aff76af71",
            "412f24cc52494ca28151e4857361b88c"
          ]
        },
        "id": "uyO5MaKkZyah",
        "outputId": "d487150b-65f3-4a4f-df22-b593594b8ecf"
      },
      "outputs": [
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
237
              "model_id": "ff5a90d6c8884a4dbf5b70453e45bcad",
lintangsutawika's avatar
lintangsutawika committed
238
              "version_major": 2,
239
240
241
242
243
              "version_minor": 0
            },
            "text/plain": [
              "Downloading builder script:   0%|          | 0.00/5.67k [00:00<?, ?B/s]"
            ]
lintangsutawika's avatar
lintangsutawika committed
244
          },
245
246
          "metadata": {},
          "output_type": "display_data"
lintangsutawika's avatar
lintangsutawika committed
247
        }
248
249
250
      ],
      "source": [
        "from lm_eval import api"
lintangsutawika's avatar
lintangsutawika committed
251
252
253
254
      ]
    },
    {
      "cell_type": "markdown",
255
256
257
      "metadata": {
        "id": "8rfUeX6n_wkK"
      },
lintangsutawika's avatar
lintangsutawika committed
258
259
260
261
262
      "source": [
        "## Make task evaluations with configurable tasks\n",
        "\n",
        "Even within the same task, many works have reported numbers based on different choices of evaluation. Some report on the test sets, validation sets, or even subset of the training sets. Others have specialized prompts and verbalizers. We introduce YAMLs to allow users to easily make different variations. By leveraging the YAML configs to configure evaluations, the refactored LM-Eval takes the methods of the `Tasks` object and makes them configurable by setting the appropriate attributes in the config file. There, users can set the tasks they want by setting the name of the HF dataset (local tasks are also possible) the dataset splits used and much more. Key configurations such as `doc_to_text`, previously implemented as a method of the same name, is now configurable with jinja2 to allow high-level scripting to transform a HF dataset to text string as input to the model.\n",
        "\n"
263
      ]
lintangsutawika's avatar
lintangsutawika committed
264
265
266
267
268
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "HYFUhhfOSJKe"
269
270
271
272
      },
      "source": [
        "A core-feature to LM-Eval is to configure tasks with YAML configs. With configs, fill preset fields to easily setup a task."
      ]
lintangsutawika's avatar
lintangsutawika committed
273
274
275
    },
    {
      "cell_type": "code",
276
277
278
279
280
      "execution_count": 3,
      "metadata": {
        "id": "bg3dGROW-V39"
      },
      "outputs": [],
lintangsutawika's avatar
lintangsutawika committed
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
      "source": [
        "YAML_boolq_string = '''\n",
        "group: yes_or_no_tasks\n",
        "task: demo_boolq\n",
        "dataset_path: super_glue\n",
        "dataset_name: boolq\n",
        "output_type: multiple_choice\n",
        "training_split: train\n",
        "validation_split: validation\n",
        "doc_to_text: \"{{passage}}\\nQuestion: {{question}}?\\nAnswer:\"\n",
        "doc_to_target: label\n",
        "doc_to_choice: [\"no\", \"yes\"]\n",
        "should_decontaminate: true\n",
        "doc_to_decontamination_query: passage\n",
        "metric_list:\n",
        "  - metric: acc\n",
        "'''\n",
        "with open('boolq.yaml', 'w') as f:\n",
        "    f.write(YAML_boolq_string)"
300
      ]
lintangsutawika's avatar
lintangsutawika committed
301
302
303
    },
    {
      "cell_type": "code",
304
      "execution_count": 4,
lintangsutawika's avatar
lintangsutawika committed
305
306
307
308
309
310
311
312
313
314
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "V-_3oDfXPIZ6",
        "outputId": "194dcfa5-f3f1-4d3e-fb35-a34d8039a423"
      },
      "outputs": [
        {
          "name": "stdout",
315
          "output_type": "stream",
lintangsutawika's avatar
lintangsutawika committed
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
          "text": [
            "2023-11-27:08:14:53,517 INFO     [utils.py:160] NumExpr defaulting to 2 threads.\n",
            "2023-11-27 08:14:54.499605: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-27 08:14:54.499658: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-27 08:14:54.499691: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-27 08:14:56.139266: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "usage: lm_eval [-h] [--model MODEL] [--tasks TASKS] [--model_args MODEL_ARGS]\n",
            "               [--num_fewshot NUM_FEWSHOT] [--batch_size BATCH_SIZE]\n",
            "               [--max_batch_size MAX_BATCH_SIZE] [--device DEVICE]\n",
            "               [--output_path = [dir/file.jsonl] [DIR]] [--limit LIMIT] [--use_cache USE_CACHE]\n",
            "               [--decontamination_ngrams_path DECONTAMINATION_NGRAMS_PATH] [--check_integrity]\n",
            "               [--write_out] [--log_samples] [--show_config] [--include_path INCLUDE_PATH]\n",
            "               [--verbosity VERBOSITY]\n",
            "lm_eval: error: unrecognized arguments: \\\n"
          ]
        }
332
333
334
335
336
337
338
339
      ],
      "source": [
        "!lm_eval \\\n",
        "    --model hf \\\n",
        "    --model_args pretrained=EleutherAI/pythia-2.8b \\\n",
        "    --include_path ./ \\\n",
        "    --tasks demo_boolq \\\n",
        "    --limit 10\n"
lintangsutawika's avatar
lintangsutawika committed
340
341
342
343
      ]
    },
    {
      "cell_type": "markdown",
344
345
346
      "metadata": {
        "id": "LOUHK7PtQfq4"
      },
lintangsutawika's avatar
lintangsutawika committed
347
348
349
350
351
352
353
354
      "source": [
        "Oftenly, tasks are part of a larger group used to meausre different capabilities. The dynamism of the field today means new dimensions of evaluation can come about which would mix and match new and older tasks alike. In LM-Eval, We can also group tasks and call that the group name to evaluate on a set of tasks easily. In this instance, let's evaluate the group `yes_or_no_tasks` which comprise of the tasks `demo_boolq` and `demo_cola`; tasks which are multiple choice tasks with options `yes` and `no` as the name suggests.\n",
        "\n",
        "<!-- making new groups is easier than ever, allowing user to work bottom-up by makiing individual tasks and linking them to a group or Top-Down, making a new group by listing existing tasks.\n",
        "\n",
        "We also show the aggregate across samples besides only showing the aggregation between subtasks. This may come in handy when certain groups want to be aggregated as a single task. -->\n",
        "\n",
        "\n"
355
      ]
lintangsutawika's avatar
lintangsutawika committed
356
357
358
    },
    {
      "cell_type": "code",
359
360
361
362
363
      "execution_count": 5,
      "metadata": {
        "id": "fthNg3ywO-kA"
      },
      "outputs": [],
lintangsutawika's avatar
lintangsutawika committed
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
      "source": [
        "YAML_cola_string = '''\n",
        "group: yes_or_no_tasks\n",
        "task: demo_cola\n",
        "dataset_path: glue\n",
        "dataset_name: cola\n",
        "output_type: multiple_choice\n",
        "training_split: train\n",
        "validation_split: validation\n",
        "doc_to_text: \"{{sentence}}\\nQuestion: Does this sentence make sense?\\nAnswer:\"\n",
        "doc_to_target: label\n",
        "doc_to_choice: [\"no\", \"yes\"]\n",
        "should_decontaminate: true\n",
        "doc_to_decontamination_query: sentence\n",
        "metric_list:\n",
        "  - metric: acc\n",
        "'''\n",
        "with open('cola.yaml', 'w') as f:\n",
        "    f.write(YAML_cola_string)"
383
      ]
lintangsutawika's avatar
lintangsutawika committed
384
385
386
    },
    {
      "cell_type": "code",
387
      "execution_count": 6,
lintangsutawika's avatar
lintangsutawika committed
388
389
390
391
392
393
394
395
396
397
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "t2p91qUi-WBR",
        "outputId": "cc22b65b-116a-4371-f709-d5cb865f99a9"
      },
      "outputs": [
        {
          "name": "stdout",
398
          "output_type": "stream",
lintangsutawika's avatar
lintangsutawika committed
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
          "text": [
            "2023-11-27:08:15:04,956 INFO     [utils.py:160] NumExpr defaulting to 2 threads.\n",
            "2023-11-27 08:15:06.059715: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-27 08:15:06.059774: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-27 08:15:06.059810: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-27 08:15:07.648550: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "2023-11-27:08:15:10,952 INFO     [__main__.py:124] Verbosity set to INFO\n",
            "2023-11-27:08:15:18,895 WARNING  [__main__.py:130]  --limit SHOULD ONLY BE USED FOR TESTING.REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.\n",
            "2023-11-27:08:15:18,895 INFO     [__main__.py:135] Including path: ./\n",
            "2023-11-27:08:15:18,915 INFO     [__main__.py:197] Selected Tasks: ['yes_or_no_tasks']\n",
            "2023-11-27:08:15:18,979 INFO     [huggingface.py:119] Using device 'cuda'\n",
            "config.json: 100% 571/571 [00:00<00:00, 2.57MB/s]\n",
            "model.safetensors: 100% 5.68G/5.68G [00:40<00:00, 142MB/s]\n",
            "tokenizer_config.json: 100% 396/396 [00:00<00:00, 1.97MB/s]\n",
            "tokenizer.json: 100% 2.11M/2.11M [00:00<00:00, 8.57MB/s]\n",
            "special_tokens_map.json: 100% 99.0/99.0 [00:00<00:00, 541kB/s]\n",
            "2023-11-27:08:16:31,344 WARNING  [task.py:612] [Task: demo_boolq] metric acc is defined, but aggregation is not. using default aggregation=mean\n",
            "2023-11-27:08:16:31,344 WARNING  [task.py:624] [Task: demo_boolq] metric acc is defined, but higher_is_better is not. using default higher_is_better=True\n",
            "Downloading builder script: 100% 30.7k/30.7k [00:00<00:00, 36.5MB/s]\n",
            "Downloading metadata: 100% 38.7k/38.7k [00:00<00:00, 660kB/s]\n",
            "Downloading readme: 100% 14.8k/14.8k [00:00<00:00, 42.8MB/s]\n",
            "Downloading data: 100% 4.12M/4.12M [00:00<00:00, 54.6MB/s]\n",
            "Generating train split: 100% 9427/9427 [00:00<00:00, 15481.88 examples/s]\n",
            "Generating validation split: 100% 3270/3270 [00:00<00:00, 19302.83 examples/s]\n",
            "Generating test split: 100% 3245/3245 [00:00<00:00, 20505.42 examples/s]\n",
            "2023-11-27:08:16:35,225 WARNING  [task.py:612] [Task: demo_cola] metric acc is defined, but aggregation is not. using default aggregation=mean\n",
            "2023-11-27:08:16:35,225 WARNING  [task.py:624] [Task: demo_cola] metric acc is defined, but higher_is_better is not. using default higher_is_better=True\n",
            "Downloading builder script: 100% 28.8k/28.8k [00:00<00:00, 36.8MB/s]\n",
            "Downloading metadata: 100% 28.7k/28.7k [00:00<00:00, 57.2MB/s]\n",
            "Downloading readme: 100% 27.9k/27.9k [00:00<00:00, 52.1MB/s]\n",
            "Downloading data: 100% 377k/377k [00:00<00:00, 11.9MB/s]\n",
            "Generating train split: 100% 8551/8551 [00:00<00:00, 28820.03 examples/s]\n",
            "Generating validation split: 100% 1043/1043 [00:00<00:00, 27790.96 examples/s]\n",
            "Generating test split: 100% 1063/1063 [00:00<00:00, 26533.12 examples/s]\n",
            "2023-11-27:08:16:38,366 INFO     [task.py:353] Building contexts for task on rank 0...\n",
            "2023-11-27:08:16:38,373 INFO     [task.py:353] Building contexts for task on rank 0...\n",
            "2023-11-27:08:16:38,379 INFO     [evaluator.py:290] Running loglikelihood requests\n",
            "100% 40/40 [00:05<00:00,  7.18it/s]\n",
            "fatal: not a git repository (or any of the parent directories): .git\n",
            "hf (pretrained=EleutherAI/pythia-2.8b), limit: 10.0, num_fewshot: None, batch_size: 1\n",
            "|     Tasks     |Version|Filter|Metric|Value|   |Stderr|\n",
            "|---------------|-------|------|------|----:|---|-----:|\n",
            "|yes_or_no_tasks|N/A    |none  |acc   | 0.85|±  |0.1303|\n",
            "| - demo_boolq  |Yaml   |none  |acc   | 1.00|±  |0.0000|\n",
            "| - demo_cola   |Yaml   |none  |acc   | 0.70|±  |0.1528|\n",
            "\n",
            "|    Groups     |Version|Filter|Metric|Value|   |Stderr|\n",
            "|---------------|-------|------|------|----:|---|-----:|\n",
            "|yes_or_no_tasks|N/A    |none  |acc   | 0.85|±  |0.1303|\n",
            "\n"
          ]
        }
451
452
453
454
455
456
457
458
459
460
461
      ],
      "source": [
        "# !accelerate launch --no_python\n",
        "!lm_eval \\\n",
        "    --model hf \\\n",
        "    --model_args pretrained=EleutherAI/pythia-2.8b \\\n",
        "    --include_path ./ \\\n",
        "    --tasks yes_or_no_tasks \\\n",
        "    --limit 10 \\\n",
        "    --output output/yes_or_no_tasks/ \\\n",
        "    --log_samples\n"
lintangsutawika's avatar
lintangsutawika committed
462
463
464
465
      ]
    },
    {
      "cell_type": "markdown",
466
467
468
      "metadata": {
        "id": "XceRKCuuDtbn"
      },
lintangsutawika's avatar
lintangsutawika committed
469
470
471
472
      "source": [
        "## Edit Prompt Templates Quickly\n",
        "\n",
        "The following is a yaml made to evaluate the specific subtask of `high_school_geography` from MMLU. It uses the standard prompt where the we choose the letters from the options with most likelihood as the model's prediction."
473
      ]
lintangsutawika's avatar
lintangsutawika committed
474
475
476
    },
    {
      "cell_type": "code",
477
478
479
480
481
      "execution_count": 7,
      "metadata": {
        "id": "GTFvdt9kSlBG"
      },
      "outputs": [],
lintangsutawika's avatar
lintangsutawika committed
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
      "source": [
        "YAML_mmlu_geo_string = '''\n",
        "group: mmlu\n",
        "task: demo_mmlu_high_school_geography\n",
        "dataset_path: cais/mmlu\n",
        "dataset_name: high_school_geography\n",
        "description: \"The following are multiple choice questions (with answers) about high school geography.\\n\\n\"\n",
        "test_split: test\n",
        "fewshot_split: dev\n",
        "fewshot_config:\n",
        "  sampler: first_n\n",
        "output_type: multiple_choice\n",
        "doc_to_text: \"{{question.strip()}}\\nA. {{choices[0]}}\\nB. {{choices[1]}}\\nC. {{choices[2]}}\\nD. {{choices[3]}}\\nAnswer:\"\n",
        "doc_to_choice: [\"A\", \"B\", \"C\", \"D\"]\n",
        "doc_to_target: answer\n",
        "metric_list:\n",
        "  - metric: acc\n",
        "    aggregation: mean\n",
        "    higher_is_better: true\n",
        "  - metric: acc_norm\n",
        "    aggregation: mean\n",
        "    higher_is_better: true\n",
        "'''\n",
        "with open('mmlu_high_school_geography.yaml', 'w') as f:\n",
        "    f.write(YAML_mmlu_geo_string)\n"
507
      ]
lintangsutawika's avatar
lintangsutawika committed
508
509
510
    },
    {
      "cell_type": "code",
511
      "execution_count": 8,
lintangsutawika's avatar
lintangsutawika committed
512
513
514
515
516
517
518
519
520
521
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "_bhGyryiTs-p",
        "outputId": "4ac4e69d-8841-456d-c617-ad1487cd3a34"
      },
      "outputs": [
        {
          "name": "stdout",
522
          "output_type": "stream",
lintangsutawika's avatar
lintangsutawika committed
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
          "text": [
            "2023-11-27:08:16:50,338 INFO     [utils.py:160] NumExpr defaulting to 2 threads.\n",
            "2023-11-27 08:16:51.182014: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-27 08:16:51.182064: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-27 08:16:51.182100: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-27 08:16:52.470541: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "2023-11-27:08:16:55,648 INFO     [__main__.py:124] Verbosity set to INFO\n",
            "2023-11-27:08:17:05,419 WARNING  [__main__.py:130]  --limit SHOULD ONLY BE USED FOR TESTING.REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.\n",
            "2023-11-27:08:17:05,420 INFO     [__main__.py:135] Including path: ./\n",
            "2023-11-27:08:17:05,433 INFO     [__main__.py:197] Selected Tasks: ['demo_mmlu_high_school_geography']\n",
            "2023-11-27:08:17:05,469 INFO     [huggingface.py:119] Using device 'cuda'\n",
            "Downloading builder script: 100% 5.84k/5.84k [00:00<00:00, 20.6MB/s]\n",
            "Downloading metadata: 100% 106k/106k [00:00<00:00, 1.74MB/s]\n",
            "Downloading readme: 100% 39.7k/39.7k [00:00<00:00, 7.61MB/s]\n",
            "Downloading data: 100% 166M/166M [00:01<00:00, 88.8MB/s]\n",
            "Generating auxiliary_train split: 100% 99842/99842 [00:08<00:00, 12231.28 examples/s]\n",
            "Generating test split: 100% 198/198 [00:00<00:00, 1271.62 examples/s]\n",
            "Generating validation split: 100% 22/22 [00:00<00:00, 2947.88 examples/s]\n",
            "Generating dev split: 100% 5/5 [00:00<00:00, 38.04 examples/s]\n",
            "2023-11-27:08:17:40,164 INFO     [task.py:353] Building contexts for task on rank 0...\n",
            "2023-11-27:08:17:40,186 INFO     [evaluator.py:290] Running loglikelihood requests\n",
            "100% 40/40 [00:05<00:00,  7.74it/s]\n",
            "fatal: not a git repository (or any of the parent directories): .git\n",
            "hf (pretrained=EleutherAI/pythia-2.8b), limit: 10.0, num_fewshot: None, batch_size: 1\n",
            "|             Tasks             |Version|Filter| Metric |Value|   |Stderr|\n",
            "|-------------------------------|-------|------|--------|----:|---|-----:|\n",
            "|demo_mmlu_high_school_geography|Yaml   |none  |acc     |  0.3|±  |0.1528|\n",
            "|                               |       |none  |acc_norm|  0.3|±  |0.1528|\n",
            "\n"
          ]
        }
554
555
556
557
558
559
560
561
562
563
564
      ],
      "source": [
        "# !accelerate launch --no_python\n",
        "!lm_eval \\\n",
        "    --model hf \\\n",
        "    --model_args pretrained=EleutherAI/pythia-2.8b \\\n",
        "    --include_path ./ \\\n",
        "    --tasks demo_mmlu_high_school_geography \\\n",
        "    --limit 10 \\\n",
        "    --output output/mmlu_high_school_geography/ \\\n",
        "    --log_samples"
lintangsutawika's avatar
lintangsutawika committed
565
566
567
568
      ]
    },
    {
      "cell_type": "markdown",
569
570
571
      "metadata": {
        "id": "jyKOfCsKb-xy"
      },
lintangsutawika's avatar
lintangsutawika committed
572
573
574
575
      "source": [
        "We could also evaluate this task in a different way. For example, instead of observing the loglikelihood of the letters, we can instead evaluate on the choices themselves as the continuation. This is done by simply changing `doc_to_choice` from a list of letters to the corresponding `choices` field from the HF dataset. We write `\"{{choices}}\"` so that the string field is interpreted as jinja string that acquires the list from the HF dataset directly.\n",
        "\n",
        "Another convinient feature here is since we're only modifying the `doc_to_choice` and the rest of config is the same as the task above, we can use the above configuration as a template by using `include: mmlu_high_school_geography.yaml` to load the config from that file. We'll need to add a unique task name as to not colide with the existing yaml config we're including. For this case we'll simply name this one `mmlu_high_school_geography_continuation`. `doc_to_text` is added here just for sake of clarity."
576
      ]
lintangsutawika's avatar
lintangsutawika committed
577
578
579
    },
    {
      "cell_type": "code",
580
581
582
583
584
      "execution_count": 9,
      "metadata": {
        "id": "lqElwU54TaK-"
      },
      "outputs": [],
lintangsutawika's avatar
lintangsutawika committed
585
586
587
588
589
590
591
592
593
      "source": [
        "YAML_mmlu_geo_string = '''\n",
        "include: mmlu_high_school_geography.yaml\n",
        "task: demo_mmlu_high_school_geography_continuation\n",
        "doc_to_text: \"{{question.strip()}}\\nA. {{choices[0]}}\\nB. {{choices[1]}}\\nC. {{choices[2]}}\\nD. {{choices[3]}}\\nAnswer:\"\n",
        "doc_to_choice: \"{{choices}}\"\n",
        "'''\n",
        "with open('mmlu_high_school_geography_continuation.yaml', 'w') as f:\n",
        "    f.write(YAML_mmlu_geo_string)\n"
594
      ]
lintangsutawika's avatar
lintangsutawika committed
595
596
597
    },
    {
      "cell_type": "code",
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
      "execution_count": 10,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "NJnMELcFTnRA",
        "outputId": "94f26428-d324-4ee2-ac2c-1cbb57fecff1"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "2023-11-27:08:17:52,429 INFO     [utils.py:160] NumExpr defaulting to 2 threads.\n",
            "2023-11-27 08:17:53.714003: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-27 08:17:53.714080: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-27 08:17:53.714119: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-27 08:17:55.953811: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "2023-11-27:08:17:59,577 INFO     [__main__.py:124] Verbosity set to INFO\n",
            "2023-11-27:08:18:07,654 WARNING  [__main__.py:130]  --limit SHOULD ONLY BE USED FOR TESTING.REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.\n",
            "2023-11-27:08:18:07,654 INFO     [__main__.py:135] Including path: ./\n",
            "2023-11-27:08:18:07,686 INFO     [__main__.py:197] Selected Tasks: ['demo_mmlu_high_school_geography_continuation']\n",
            "2023-11-27:08:18:07,735 INFO     [huggingface.py:119] Using device 'cuda'\n",
            "2023-11-27:08:18:25,609 INFO     [task.py:353] Building contexts for task on rank 0...\n",
            "2023-11-27:08:18:25,628 INFO     [evaluator.py:290] Running loglikelihood requests\n",
            "100% 40/40 [00:05<00:00,  7.68it/s]\n",
            "fatal: not a git repository (or any of the parent directories): .git\n",
            "hf (pretrained=EleutherAI/pythia-2.8b), limit: 10.0, num_fewshot: None, batch_size: 1\n",
            "|                   Tasks                    |Version|Filter| Metric |Value|   |Stderr|\n",
            "|--------------------------------------------|-------|------|--------|----:|---|-----:|\n",
            "|demo_mmlu_high_school_geography_continuation|Yaml   |none  |acc     |  0.1|±  |0.1000|\n",
            "|                                            |       |none  |acc_norm|  0.2|±  |0.1333|\n",
            "\n"
          ]
        }
      ],
lintangsutawika's avatar
lintangsutawika committed
634
635
636
637
638
639
640
641
642
643
      "source": [
        "# !accelerate launch --no_python\n",
        "!lm_eval \\\n",
        "    --model hf \\\n",
        "    --model_args pretrained=EleutherAI/pythia-2.8b \\\n",
        "    --include_path ./ \\\n",
        "    --tasks demo_mmlu_high_school_geography_continuation \\\n",
        "    --limit 10 \\\n",
        "    --output output/mmlu_high_school_geography_continuation/ \\\n",
        "    --log_samples\n"
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "-_CVnDirdy7j"
      },
      "source": [
        "If we take a look at the samples, we can see that it is in fact evaluating the continuation based on the choices rather than the letters."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 17
        },
        "id": "-3eoXdXzUOjT",
        "outputId": "0201ee0a-5cfa-4cda-8187-edfddb205d66"
      },
      "outputs": [
        {
          "data": {
            "application/javascript": "\n      ((filepath) => {{\n        if (!google.colab.kernel.accessAllowed) {{\n          return;\n        }}\n        google.colab.files.view(filepath);\n      }})(\"/content/output/mmlu_high_school_geography_continuation/pretrained__EleutherAI__pythia-2.8b_demo_mmlu_high_school_geography_continuation.jsonl\")",
            "text/plain": [
              "<IPython.core.display.Javascript object>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
lintangsutawika's avatar
lintangsutawika committed
677
      ],
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
      "source": [
        "from google.colab import files\n",
        "files.view(\"output/mmlu_high_school_geography_continuation/pretrained__EleutherAI__pythia-2.8b_demo_mmlu_high_school_geography_continuation.jsonl\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "duBDqC6PAdjL"
      },
      "source": [
        "## Closer Look at YAML Fields\n",
        "\n",
        "To prepare a task we can simply fill in a YAML config with the relevant information.\n",
        "\n",
        "`output_type`\n",
        "The current provided evaluation types comprise of the following:\n",
        "1.   `loglikelihood`: Evaluates the loglikeihood of a continuation\n",
        "2.   `loglikelihood_rolling`\n",
        "3.   `multiple_choice`: Evaluates loglikelihood among the a number of choices predicted by the model.\n",
        "4.   `greedy_until`: Model outputs greedy generation (can be configured to to use beam search and other generation-related paramaters)\n",
        "\n",
        "The core prompt revolves around 3 fields.\n",
        "1. `doc_to_text`: Denotes the prompt template that will be used as input to the model.\n",
        "2. `doc_to_choice`: Available choices that will be used as continuation for the model. This is used when the `output_type` is `multiple_choice`.\n",
        "3. `doc_to_target`: When `output_type` is `multiple_choice` this can be an index that corresponds to the correct answer or the answer string itself (must be a subset of `doc_to_choice`). For other tasks, this is expected to be a string. You can fill this field with a feature name from the HF dataset so long as the resulting feature follows the conditioned described.\n",
        "\n",
        "<!-- Advanced notes:\n",
        "In some cases, like Winograd, we want to alternate the left-hand side of a prompt and keep the answer the same -->\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6p0-KPwAgK5j"
      },
      "source": [
        "## What if Jinja is not Sufficient?\n",
        "\n",
        "There can be times where Jinja is not enough to make the prompt we had in mind.\n",
        "\n",
        "1. Use `!function` operator for the prompt-related fields to pass a python function to build the prompt template.\n",
        "2. Transform the dataset"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
lintangsutawika's avatar
lintangsutawika committed
726
727
728
729
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
        "id": "DYZ5c0JhR1lJ",
        "outputId": "3a9fd1e4-6b3e-46cf-9a9e-ca316f6e1b65"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "2023-11-27:08:18:37,991 INFO     [utils.py:160] NumExpr defaulting to 2 threads.\n",
            "2023-11-27 08:18:39.666844: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-27 08:18:39.666894: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-27 08:18:39.666949: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-27 08:18:41.101009: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "2023-11-27:08:18:44,452 INFO     [__main__.py:124] Verbosity set to INFO\n",
            "2023-11-27:08:18:54,278 WARNING  [__main__.py:130]  --limit SHOULD ONLY BE USED FOR TESTING.REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.\n",
            "2023-11-27:08:18:54,279 INFO     [__main__.py:135] Including path: ./\n",
            "2023-11-27:08:18:54,303 INFO     [__main__.py:197] Selected Tasks: ['demo_mmlu_high_school_geography_function_prompt']\n",
            "2023-11-27:08:18:54,333 INFO     [huggingface.py:119] Using device 'cuda'\n",
            "2023-11-27:08:19:12,078 INFO     [task.py:353] Building contexts for task on rank 0...\n",
            "2023-11-27:08:19:12,084 INFO     [evaluator.py:290] Running loglikelihood requests\n",
            "100% 40/40 [00:02<00:00, 16.47it/s]\n",
            "fatal: not a git repository (or any of the parent directories): .git\n",
            "hf (pretrained=EleutherAI/pythia-2.8b), limit: 10.0, num_fewshot: None, batch_size: 1\n",
            "|                     Tasks                     |Version|Filter| Metric |Value|   |Stderr|\n",
            "|-----------------------------------------------|-------|------|--------|----:|---|-----:|\n",
            "|demo_mmlu_high_school_geography_function_prompt|Yaml   |none  |acc     |  0.1|±  |0.1000|\n",
            "|                                               |       |none  |acc_norm|  0.2|±  |0.1333|\n",
            "\n"
          ]
        }
      ],
      "source": [
        "YAML_mmlu_geo_string = '''\n",
        "include: mmlu_high_school_geography.yaml\n",
        "task: demo_mmlu_high_school_geography_function_prompt\n",
        "doc_to_text: !function utils.doc_to_text\n",
        "doc_to_choice: \"{{choices}}\"\n",
        "'''\n",
        "with open('demo_mmlu_high_school_geography_function_prompt.yaml', 'w') as f:\n",
        "    f.write(YAML_mmlu_geo_string)\n",
        "\n",
        "DOC_TO_TEXT = '''\n",
        "def doc_to_text(x):\n",
        "    question = x[\"question\"].strip()\n",
        "    choices = x[\"choices\"]\n",
        "    option_a = choices[0]\n",
        "    option_b = choices[1]\n",
        "    option_c = choices[2]\n",
        "    option_d = choices[3]\n",
        "    return f\"{question}\\\\nA. {option_a}\\\\nB. {option_b}\\\\nC. {option_c}\\\\nD. {option_d}\\\\nAnswer:\"\n",
        "'''\n",
        "with open('utils.py', 'w') as f:\n",
        "    f.write(DOC_TO_TEXT)\n",
        "\n",
        "!lm_eval \\\n",
        "    --model hf \\\n",
        "    --model_args pretrained=EleutherAI/pythia-2.8b \\\n",
        "    --include_path ./ \\\n",
        "    --tasks demo_mmlu_high_school_geography_function_prompt \\\n",
        "    --limit 10 \\\n",
        "    --output output/demo_mmlu_high_school_geography_function_prompt/ \\\n",
        "    --log_samples\n"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "collapsed_sections": [
        "zAov81vTbL2K"
      ],
      "gpuType": "T4",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "11451d297d3d4037b9fd6010d2097843": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "164724b8d45a4adfbd44805cc16ca032": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "18171a183d1e4dd5a4f6670e517dcc1d": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "214bcd0301bd423b8ed691cace119137": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_164724b8d45a4adfbd44805cc16ca032",
            "placeholder": "​",
            "style": "IPY_MODEL_18171a183d1e4dd5a4f6670e517dcc1d",
            "value": "Downloading builder script: 100%"
          }
        },
        "412f24cc52494ca28151e4857361b88c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "460777325dd64ecaa929021ffc9d5f3a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_8c4e29d728264a5caf38dc3781a017a8",
            "max": 5669,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_52c8d0cf3e7f48959883934856331286",
            "value": 5669
          }
        },
        "4a50bd7b62d94f40a13a2cb7fbc0ba4b": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_8f62151425e345128a110b6aff76af71",
            "placeholder": "​",
            "style": "IPY_MODEL_412f24cc52494ca28151e4857361b88c",
            "value": " 5.67k/5.67k [00:00&lt;00:00, 335kB/s]"
          }
        },
        "52c8d0cf3e7f48959883934856331286": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "8c4e29d728264a5caf38dc3781a017a8": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "8f62151425e345128a110b6aff76af71": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
lintangsutawika's avatar
lintangsutawika committed
1132
        },
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
        "ff5a90d6c8884a4dbf5b70453e45bcad": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_214bcd0301bd423b8ed691cace119137",
              "IPY_MODEL_460777325dd64ecaa929021ffc9d5f3a",
              "IPY_MODEL_4a50bd7b62d94f40a13a2cb7fbc0ba4b"
lintangsutawika's avatar
lintangsutawika committed
1151
            ],
1152
1153
            "layout": "IPY_MODEL_11451d297d3d4037b9fd6010d2097843"
          }
lintangsutawika's avatar
lintangsutawika committed
1154
1155
1156
        }
      }
    }
1157
1158
1159
1160
  },
  "nbformat": 4,
  "nbformat_minor": 0
}