Commit 327097b7 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 465401547
parent df4a0906
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"id": "Bp8t2AI8i7uP" "id": "Bp8t2AI8i7uP"
}, },
"source": [ "source": [
"##### Copyright 2020 The TensorFlow Authors." "##### Copyright 2022 The TensorFlow Authors."
] ]
}, },
{ {
...@@ -46,20 +46,20 @@ ...@@ -46,20 +46,20 @@
"id": "Mwb9uw1cDXsa" "id": "Mwb9uw1cDXsa"
}, },
"source": [ "source": [
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n", "<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" \u003ctd\u003e\n", " <td>\n",
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/tfmodels/nlp/customize_encoder\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n", " <a target=\"_blank\" href=\"https://www.tensorflow.org/tfmodels/nlp/customize_encoder\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
" \u003c/td\u003e\n", " </td>\n",
" \u003ctd\u003e\n", " <td>\n",
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/docs/nlp/customize_encoder.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n", " <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/docs/nlp/customize_encoder.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
" \u003c/td\u003e\n", " </td>\n",
" \u003ctd\u003e\n", " <td>\n",
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/docs/nlp/customize_encoder.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n", " <a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/docs/nlp/customize_encoder.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
" \u003c/td\u003e\n", " </td>\n",
" \u003ctd\u003e\n", " <td>\n",
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/models/docs/nlp/customize_encoder.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n", " <a href=\"https://storage.googleapis.com/tensorflow_docs/models/docs/nlp/customize_encoder.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
" \u003c/td\u003e\n", " </td>\n",
"\u003c/table\u003e" "</table>"
] ]
}, },
{ {
...@@ -105,9 +105,7 @@ ...@@ -105,9 +105,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"# Uninstall colab's opencv-python, it conflicts with `opencv-python-headless`\n", "!pip install -q opencv-python"
"# which is installed by tf-models-official\n",
"!pip uninstall -y opencv-python"
] ]
}, },
{ {
...@@ -118,7 +116,7 @@ ...@@ -118,7 +116,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install -q tf-models-nightly" "!pip install -q tf-models-official"
] ]
}, },
{ {
...@@ -142,7 +140,7 @@ ...@@ -142,7 +140,7 @@
"import tensorflow as tf\n", "import tensorflow as tf\n",
"\n", "\n",
"import tensorflow_models as tfm\n", "import tensorflow_models as tfm\n",
"from tensorflow_models import nlp" "nlp = tfm.nlp"
] ]
}, },
{ {
...@@ -541,7 +539,7 @@ ...@@ -541,7 +539,7 @@
"\n", "\n",
"Finally, you could also build a new encoder using building blocks in the modeling library.\n", "Finally, you could also build a new encoder using building blocks in the modeling library.\n",
"\n", "\n",
"See [the source for `nlp.networks.AlbertEncoder`](https://github.com/tensorflow/models/blob/master/official/nlp/modeling/networks/albert_encoder.py) as an example of how to du this. \n", "See [the source for `nlp.networks.AlbertEncoder`](https://github.com/tensorflow/models/blob/master/official/nlp/modeling/networks/albert_encoder.py) as an example of how to do this. \n",
"\n", "\n",
"Here is an example using `nlp.networks.AlbertEncoder`:\n" "Here is an example using `nlp.networks.AlbertEncoder`:\n"
] ]
...@@ -566,7 +564,7 @@ ...@@ -566,7 +564,7 @@
"id": "MeidDfhlHKSO" "id": "MeidDfhlHKSO"
}, },
"source": [ "source": [
"Inspecting the `albert_encoder`, we see it stacks the same `Transformer` layer multiple times." "Inspecting the `albert_encoder`, we see it stacks the same `Transformer` layer multiple times (note the loop-back on the \"Transformer\" block below.."
] ]
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment