diff --git a/site/en/guide/keras/preprocessing_layers.ipynb b/site/en/guide/keras/preprocessing_layers.ipynb index 06aa34119e8..b4289af5e3d 100644 --- a/site/en/guide/keras/preprocessing_layers.ipynb +++ b/site/en/guide/keras/preprocessing_layers.ipynb @@ -734,7 +734,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "fe8e1ea80f6e" + "id": "5b6c0fec928e" }, "outputs": [], "source": [ @@ -751,7 +751,10 @@ "# (multi-hot with TF-IDF weighting) and ngrams=2 (index all bigrams)\n", "text_vectorizer = layers.TextVectorization(output_mode=\"tf-idf\", ngrams=2)\n", "# Index the bigrams and learn the TF-IDF weights via `adapt()`\n", - "text_vectorizer.adapt(adapt_data)\n", + "\n", + "with tf.device(\"CPU\"):\n", + " # A bug that prevents this from running on GPU for now.\n", + " text_vectorizer.adapt(adapt_data)\n", "\n", "# Try out the layer\n", "print(\n",