File size: 8,596 Bytes
b0c0df0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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 59 60 61 62 63 64 65 66 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 211 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 237 238 239 240 241 242 243 244 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Generating test split: 100%|ββββββββββ| 4/4 [00:00<00:00, 860.15 examples/s]\n"
]
}
],
"source": [
"import datasets\n",
"\n",
"data = datasets.load_dataset(\"lmms-lab/LiveBenchResults\", \"2024-09\")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"df = pd.DataFrame(data[\"test\"])\n",
"df = df.drop(columns=\"__index_level_0__\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Model Name</th>\n",
" <th>Total</th>\n",
" <th>Concrete Recognition</th>\n",
" <th>Analytical Questions</th>\n",
" <th>Divergent Thinking</th>\n",
" <th>Real-world Assistance</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>LLaVA-1.5-7B</td>\n",
" <td>30.15000</td>\n",
" <td>9.400</td>\n",
" <td>36.4</td>\n",
" <td>45.4</td>\n",
" <td>29.400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>GPT-4o-mini</td>\n",
" <td>91.90475</td>\n",
" <td>94.644</td>\n",
" <td>93.4</td>\n",
" <td>95.3</td>\n",
" <td>84.275</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>LLaVA-OneVision-0.5B</td>\n",
" <td>32.36300</td>\n",
" <td>25.052</td>\n",
" <td>33.6</td>\n",
" <td>40.2</td>\n",
" <td>30.600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>LLaVA-OneVision-7B</td>\n",
" <td>64.85775</td>\n",
" <td>57.206</td>\n",
" <td>67.0</td>\n",
" <td>76.2</td>\n",
" <td>59.025</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model Name Total Concrete Recognition Analytical Questions \\\n",
"0 LLaVA-1.5-7B 30.15000 9.400 36.4 \n",
"1 GPT-4o-mini 91.90475 94.644 93.4 \n",
"2 LLaVA-OneVision-0.5B 32.36300 25.052 33.6 \n",
"3 LLaVA-OneVision-7B 64.85775 57.206 67.0 \n",
"\n",
" Divergent Thinking Real-world Assistance \n",
"0 45.4 29.400 \n",
"1 95.3 84.275 \n",
"2 40.2 30.600 \n",
"3 76.2 59.025 "
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"ename": "KeyError",
"evalue": "'__index_level_0__'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[7], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# data = data.filter(lambda x: x[\"Model Name\"] != \"LLaVA-OneVision-1.5B\")\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mdata\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtest\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdrop_index\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m__index_level_0__\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/data/pufanyi/anaconda3/anacondabin/envs/live_bench/lib/python3.12/site-packages/datasets/search.py:691\u001b[0m, in \u001b[0;36mIndexableMixin.drop_index\u001b[0;34m(self, index_name)\u001b[0m\n\u001b[1;32m 684\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdrop_index\u001b[39m(\u001b[38;5;28mself\u001b[39m, index_name: \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 685\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Drop the index with the specified column.\u001b[39;00m\n\u001b[1;32m 686\u001b[0m \n\u001b[1;32m 687\u001b[0m \u001b[38;5;124;03m Args:\u001b[39;00m\n\u001b[1;32m 688\u001b[0m \u001b[38;5;124;03m index_name (`str`):\u001b[39;00m\n\u001b[1;32m 689\u001b[0m \u001b[38;5;124;03m The `index_name`/identifier of the index.\u001b[39;00m\n\u001b[1;32m 690\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 691\u001b[0m \u001b[38;5;28;01mdel\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_indexes\u001b[49m\u001b[43m[\u001b[49m\u001b[43mindex_name\u001b[49m\u001b[43m]\u001b[49m\n",
"\u001b[0;31mKeyError\u001b[0m: '__index_level_0__'"
]
}
],
"source": [
"# data = data.filter(lambda x: x[\"Model Name\"] != \"LLaVA-OneVision-1.5B\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"data = datasets.Dataset.from_pandas(df, split=\"test\", preserve_index=False)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Dataset({\n",
" features: ['Model Name', 'Total', 'Concrete Recognition', 'Analytical Questions', 'Divergent Thinking', 'Real-world Assistance'],\n",
" num_rows: 4\n",
"})"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Creating parquet from Arrow format: 100%|ββββββββββ| 1/1 [00:00<00:00, 634.64ba/s]\n",
"Uploading the dataset shards: 100%|ββββββββββ| 1/1 [00:01<00:00, 1.24s/it]\n"
]
},
{
"data": {
"text/plain": [
"CommitInfo(commit_url='https://huggingface.co/datasets/lmms-lab/LiveBenchResults/commit/e8e81e7a3ddd5611340c25235c9c73ce40b0bed1', commit_message='Upload dataset', commit_description='', oid='e8e81e7a3ddd5611340c25235c9c73ce40b0bed1', pr_url=None, repo_url=RepoUrl('https://huggingface.co/datasets/lmms-lab/LiveBenchResults', endpoint='https://huggingface.co', repo_type='dataset', repo_id='lmms-lab/LiveBenchResults'), pr_revision=None, pr_num=None)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.push_to_hub(\"lmms-lab/LiveBenchResults\", \"2024-09\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "live_bench",
"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.12.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|