Repository: keras-team/keras-nlp
Pull request #273 (2022-07-20 12:58:47)

Fixed typo: "recieved"

jbischof: `i` before `e` except after `c` :)

Thanks!

Patch:
diff --git a/cloudbuild/Dockerfile b/cloudbuild/Dockerfile
index f281da98..61db9df2 100644
--- a/cloudbuild/Dockerfile
+++ b/cloudbuild/Dockerfile
@@ -1,7 +1,4 @@
-# Creates environment to run unit tests with current nightly image.
-FROM tensorflow/tensorflow:2.9.1-gpu
+# keras-nlp-image:deps has all deps of KerasNLP for testing.
+FROM us-west1-docker.pkg.dev/keras-team-test/keras-nlp-test/keras-nlp-image:deps
 COPY . /kerasnlp
 WORKDIR /kerasnlp
-RUN apt-get -y update
-RUN apt-get -y install git
-RUN pip install -r cloudbuild/requirements.txt
\ No newline at end of file
diff --git a/cloudbuild/cloudbuild.yaml b/cloudbuild/cloudbuild.yaml
index 406e11ff..2c104be1 100644
--- a/cloudbuild/cloudbuild.yaml
+++ b/cloudbuild/cloudbuild.yaml
@@ -1,16 +1,12 @@
 substitutions:
-  # GCS location to write temporary checkpoints and summaries.
-  # TODO(chenmoneygithub): Change the bucket to a stable one after GPU is 
-  # granted for keras-team-test.
-  _GCS_BUCKET: 'gs://keras-nlp-test'
-  # Name of GKE cluster in which to run Job.
-  # TODO(chenmoneygithub): Change the cluster to a stable one after GPU is 
-  # granted for keras-team-test.
-  _CLUSTER_NAME: 'tutorial-cluster'
+  # GCS bucket name. 
+  _GCS_BUCKET: 'gs://keras-nlp-github-test'
+  # GKE cluster name.
+  _CLUSTER_NAME: 'keras-nlp-test-cluster'
   # Location of GKE cluster.
-  _CLUSTER_ZONE: 'us-central1-b'
+  _CLUSTER_ZONE: 'us-west1-b'
   # Image name.
-  _IMAGE_NAME: 'us-central1-docker.pkg.dev/keras-team-gcp/keras-nlp-test/test-image'
+  _IMAGE_NAME: 'us-west1-docker.pkg.dev/keras-team-test/keras-nlp-test/keras-nlp-image'
 steps:
 - name: 'docker'
   id: build-image
@@ -68,16 +64,16 @@ steps:
     set -u
     set -e
     set -x
-
-    gcloud container clusters get-credentials $_CLUSTER_NAME --zone $_CLUSTER_ZONE --project keras-team-gcp
+    gcloud container clusters get-credentials $_CLUSTER_NAME --zone $_CLUSTER_ZONE --project keras-team-test
     job_name=$(kubectl create -f output.yaml -o name)
     sleep 5
     pod_name=$(kubectl wait --for condition=ready --timeout=10m pod -l job-name=${job_name#job.batch/} -o name)
     kubectl logs -f $pod_name --container=train
     sleep 5
+    gcloud artifacts docker images delete $_IMAGE_NAME:$BUILD_ID
     exit $(kubectl get $pod_name -o jsonpath={.status.containerStatuses[0].state.terminated.exitCode})
 timeout: 1800s  # 30 minutes
 options:
   volumes:
   - name: go-modules
-    path: /go
\ No newline at end of file
+    path: /go
diff --git a/keras_nlp/tokenizers/word_piece_tokenizer.py b/keras_nlp/tokenizers/word_piece_tokenizer.py
index 0f84a299..b078f1ef 100644
--- a/keras_nlp/tokenizers/word_piece_tokenizer.py
+++ b/keras_nlp/tokenizers/word_piece_tokenizer.py
@@ -85,7 +85,7 @@ def pretokenize(text, lowercase, strip_accents, split):
     if text.dtype != tf.string:
         raise ValueError(
             "The dataset elements in `data` must have string dtype. "
-            f"Recieved: {text.dtype}."
+            f"Received: {text.dtype}."
         )
     # Preprocess, lowercase, strip and split input data.
     if text.shape.rank == 0:
diff --git a/keras_nlp/tokenizers/word_piece_tokenizer_trainer.py b/keras_nlp/tokenizers/word_piece_tokenizer_trainer.py
index 7d455b43..a3e4bd3a 100644
--- a/keras_nlp/tokenizers/word_piece_tokenizer_trainer.py
+++ b/keras_nlp/tokenizers/word_piece_tokenizer_trainer.py
@@ -115,7 +115,7 @@ def compute_word_piece_vocabulary(
     if not isinstance(data, (list, tf.data.Dataset)):
         raise ValueError(
             "The `data` argument must be either `tf.data.Dataset` or `list`. "
-            f"Recieved: {type(data)}."
+            f"Received: {type(data)}."
         )
     if isinstance(data, list):
         if not split:


Test patch:
diff --git a/cloudbuild/unit_test_jobs.jsonnet b/cloudbuild/unit_test_jobs.jsonnet
index dfb3b424..d04964cf 100644
--- a/cloudbuild/unit_test_jobs.jsonnet
+++ b/cloudbuild/unit_test_jobs.jsonnet
@@ -15,7 +15,7 @@ local unittest = base.BaseTest {
   // Set up runtime environment.
   image: image,
   imageTag: tagName,
-  accelerator: gpus.teslaV100,
+  accelerator: gpus.teslaT4,
   outputBucket: gcsBucket,
 
   entrypoint: [
diff --git a/keras_nlp/tokenizers/word_piece_tokenizer_trainer_test.py b/keras_nlp/tokenizers/word_piece_tokenizer_trainer_test.py
index 6bdf587d..e048966e 100644
--- a/keras_nlp/tokenizers/word_piece_tokenizer_trainer_test.py
+++ b/keras_nlp/tokenizers/word_piece_tokenizer_trainer_test.py
@@ -61,13 +61,13 @@ class WordPieceTokenizerTrainerTest(tf.test.TestCase):
         with self.assertRaisesRegex(
             ValueError,
             "The dataset elements in `data` must have string dtype. "
-            "Recieved: <dtype: 'int32'>.",
+            "Received: <dtype: 'int32'>.",
         ):
             compute_word_piece_vocabulary(test_text_invalid, 10)
         with self.assertRaisesRegex(
             ValueError,
             "The `data` argument must be either `tf.data.Dataset` or `list`. "
-            "Recieved: <class 'int'>.",
+            "Received: <class 'int'>.",
         ):
             compute_word_piece_vocabulary(4, 4)