Reduce size of diff #2

This commit is contained in:
or-toledano 2021-08-09 08:26:41 +03:00 committed by Jong Wook Kim
parent ea7f744b2f
commit 311a0784a2
1 changed files with 30 additions and 30 deletions

View File

@ -713,7 +713,7 @@
"output_type": "execute_result",
"data": {
"text/plain": [
"['RN50', 'ViT-f']"
"['RN50', 'ViT-B/32']"
]
},
"metadata": {
@ -733,43 +733,43 @@
"outputId": "58e644d4-6e23-43b5-964e-1e9e8540d22e"
},
"source": [
"jit = True\n",
"model, preprocess = clip.load(\"ViT-B/32\", jit=jit)"
"jit = True\n",
"model, preprocess = clip.load(\"ViT-B/32\", jit=jit)"
],
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"text": [
"100%|██████████████████████| 353976522/353976522 [00:01<00:00, 188872424.30it/s]\n"
],
"name": "stderr"
}
{
"output_type": "stream",
"text": [
"100%|██████████████████████| 353976522/353976522 [00:01<00:00, 188872424.30it/s]\n"
],
"name": "stderr"
}
]
},
{
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "IBRVTY9lbGm8",
"outputId": "58641dc2-919d-40ae-b71a-7b7b47830f77"
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "IBRVTY9lbGm8",
"outputId": "58641dc2-919d-40ae-b71a-7b7b47830f77"
},
"source": [
"if jit:\n",
" input_resolution = model.input_resolution.item()\n",
" context_length = model.context_length.item()\n",
" vocab_size = model.vocab_size.item()\n",
"else:\n",
" input_resolution = model.visual.input_resolution\n",
" context_length = model.context_length\n",
" vocab_size = model.vocab_size\n",
"\n",
"print(\"Model parameters:\", f\"{np.sum([int(np.prod(p.shape)) for p in model.parameters()]):,}\")\n",
"print(\"Input resolution:\", input_resolution)\n",
"print(\"Context length:\", context_length)\n",
"print(\"Vocab size:\", vocab_size)"
"if jit:\n",
" input_resolution = model.input_resolution.item()\n",
" context_length = model.context_length.item()\n",
" vocab_size = model.vocab_size.item()\n",
"else:\n",
" input_resolution = model.visual.input_resolution\n",
" context_length = model.context_length\n",
" vocab_size = model.vocab_size\n",
"\n",
"print(\"Model parameters:\", f\"{np.sum([int(np.prod(p.shape)) for p in model.parameters()]):,}\")\n",
"print(\"Input resolution:\", input_resolution)\n",
"print(\"Context length:\", context_length)\n",
"print(\"Vocab size:\", vocab_size)"
],
"execution_count": 7,
"outputs": [