@@ -251,7 +251,7 @@ def preprocess(inputs):
251251 # Split the masking layer outputs into a (features, labels, and weights)
252252 # tuple that we can use with keras.Model.fit().
253253 features = {
254- "token_ids " : outputs ["token_ids " ],
254+ "tokens " : outputs ["tokens " ],
255255 "mask_positions" : outputs ["mask_positions" ],
256256 }
257257 labels = outputs ["mask_ids" ]
@@ -277,7 +277,7 @@ def preprocess(inputs):
277277
278278We have two features:
279279
280- 1. `"token_ids "`, where some tokens have been replaced with our mask token id.
280+ 1. `"tokens "`, where some tokens have been replaced with our mask token id.
2812812. `"mask_positions"`, which keeps track of which tokens we masked out.
282282
283283Our labels are simply the ids we masked out.
@@ -350,12 +350,12 @@ def preprocess(inputs):
350350
351351# Create the pretraining model by attaching a masked language model head.
352352inputs = {
353- "token_ids " : keras .Input (shape = (SEQ_LENGTH ,), dtype = tf .int32 ),
353+ "tokens " : keras .Input (shape = (SEQ_LENGTH ,), dtype = tf .int32 ),
354354 "mask_positions" : keras .Input (shape = (PREDICTIONS_PER_SEQ ,), dtype = tf .int32 ),
355355}
356356
357357# Encode the tokens.
358- encoded_tokens = encoder_model (inputs ["token_ids " ])
358+ encoded_tokens = encoder_model (inputs ["tokens " ])
359359
360360# Predict an output word for each masked input token.
361361# We use the input token embedding to project from our encoded vectors to
0 commit comments