Skip to content

Commit

Permalink
Update example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeMe committed May 3, 2022
1 parent e85cd38 commit 9f068a4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions examples/00_intro_to_thinc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"outputs": [],
"source": [
"import thinc.util\n",
"import thinc.compat\n",
"# If you want to run this notebook on GPU, you'll need to install cupy.\n",
"if not thinc.util.has_cupy:\n",
"if not thinc.compat.has_cupy:\n",
" !pip install \"cupy-cuda101\""
]
},
Expand All @@ -59,11 +59,11 @@
},
"outputs": [],
"source": [
"import thinc.util\n",
"import thinc.compat\n",
"# If you want to try out the tensorflow integration, you'll need to install that.\n",
"# You'll either need to do tensorflow or tensorflow-gpu, depending on your\n",
"# requirements.\n",
"if not thinc.util.has_tensorflow:\n",
"if not thinc.compat.has_tensorflow:\n",
" !pip install \"tensorflow-gpu>=2\""
]
},
Expand All @@ -75,9 +75,9 @@
},
"outputs": [],
"source": [
"import thinc.util\n",
"import thinc.compat\n",
"# If you want to try out the PyTorch integration, you'll need to install it.\n",
"if not thinc.util.has_torch:\n",
"if not thinc.compat.has_torch:\n",
" !pip install \"torch\""
]
},
Expand All @@ -89,9 +89,9 @@
},
"outputs": [],
"source": [
"import thinc.util\n",
"import thinc.compat\n",
"# If you want to try out the MxNet integration, you'll need to install it.\n",
"if not thinc.util.has_mxnet:\n",
"if not thinc.compat.has_mxnet:\n",
" !pip install \"mxnet>=1.5.1,<1.6.0\""
]
},
Expand All @@ -117,10 +117,10 @@
"outputs": [],
"source": [
"from thinc.api import prefer_gpu\n",
"import thinc.util\n",
"import thinc.compat\n",
"print(\"Thinc GPU?\", prefer_gpu())\n",
"\n",
"if thinc.util.has_tensorflow:\n",
"if thinc.compat.has_tensorflow:\n",
" import tensorflow as tf\n",
" print(\"Tensorflow GPU?\", bool(tf.config.experimental.list_physical_devices('GPU')))"
]
Expand Down Expand Up @@ -1374,9 +1374,9 @@
"source": [
"from mxnet.gluon.nn import Dense, Sequential, Dropout\n",
"from thinc.api import MXNetWrapper, chain, Softmax\n",
"import thinc.util\n",
"import thinc.compat\n",
"\n",
"assert thinc.util.has_mxnet\n",
"assert thinc.compat.has_mxnet\n",
"\n",
"width = 32\n",
"nO = 10\n",
Expand Down

0 comments on commit 9f068a4

Please sign in to comment.