Skip to content

Commit

Permalink
use pkg_resources for PyTorch version checks in notebooks (openai#191)
Browse files Browse the repository at this point in the history
* use pkg_resources for PyTorch version checks in notebooks

* remove version checking in notebook code cell

Co-authored-by: Jong Wook Kim <jongwook@nyu.edu>
  • Loading branch information
neverix and jongwook authored Apr 10, 2022
1 parent 3482bb6 commit e58d494
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions notebooks/Interacting_with_CLIP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,9 @@
"source": [
"import numpy as np\n",
"import torch\n",
"from pkg_resources import packaging\n",
"\n",
"print(\"Torch version:\", torch.__version__)\n",
"\n",
"assert torch.__version__.split(\".\") >= [\"1\", \"7\", \"1\"], \"PyTorch 1.7.1 or later is required\""
"print(\"Torch version:\", torch.__version__)\n"
],
"execution_count": 2,
"outputs": [
Expand Down
7 changes: 3 additions & 4 deletions notebooks/Prompt_Engineering_for_ImageNet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,9 @@
"import torch\n",
"import clip\n",
"from tqdm.notebook import tqdm\n",
"from pkg_resources import packaging\n",
"\n",
"print(\"Torch version:\", torch.__version__)\n",
"\n",
"assert torch.__version__.split(\".\") >= [\"1\", \"7\", \"1\"], \"PyTorch 1.7.1 or later is required\""
"print(\"Torch version:\", torch.__version__)\n"
],
"execution_count": 2,
"outputs": [
Expand Down Expand Up @@ -1105,4 +1104,4 @@
]
}
]
}
}

0 comments on commit e58d494

Please sign in to comment.