Skip to content

Commit 478e055

Browse files
committed
fix merge conflicts
2 parents 830e0c1 + d98ebb9 commit 478e055

File tree

7 files changed

+2360
-22
lines changed

7 files changed

+2360
-22
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Ensure files are formatted with black
1414
run: |
1515
pip install --upgrade pip
16-
pip install black==22.1.0
16+
pip install black~=22.3.0
1717
black --check --diff ./examples
1818
docker-image:
1919
runs-on: ubuntu-latest

examples/nlp/md/multi_label_classification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
**Description:** Implementing a large-scale multi-label text classification model.
77

88

9-
<img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favicon.ico"/> [**View in Colab**](https://colab.research.google.com/github/keras-team\keras-io\blob\master\examples\nlp/ipynb/multi_label_classification.ipynb) <span class="k-dot">•</span><img class="k-inline-icon" src="https://github.com/favicon.ico"/> [**GitHub source**](https://github.com/keras-team\keras-io\blob\master\examples\nlp/multi_label_classification.py)
9+
<img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favicon.ico"/> [**View in Colab**](https://colab.research.google.com/github/keras-team\keras-io\blob\master\examples\nlp/ipynb/multi_label_classification.ipynb) <span class="k-dot">•</span><img class="k-inline-icon" src="https://github.com/favicon.ico"/> [**GitHub source**](https://github.com/keras-team\keras-io\blob\master\examples\nlp/multi_label_classification.py)
1010

1111

1212

guides/keras_nlp/transformer_pretraining.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
"tokens": outputs["tokens"],
254+
"token_ids": outputs["token_ids"],
255255
"mask_positions": outputs["mask_positions"],
256256
}
257257
labels = outputs["mask_ids"]
@@ -277,7 +277,7 @@ def preprocess(inputs):
277277
278278
We have two features:
279279
280-
1. `"tokens"`, where some tokens have been replaced with our mask token id.
280+
1. `"token_ids"`, where some tokens have been replaced with our mask token id.
281281
2. `"mask_positions"`, which keeps track of which tokens we masked out.
282282
283283
Our 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.
352352
inputs = {
353-
"tokens": keras.Input(shape=(SEQ_LENGTH,), dtype=tf.int32),
353+
"token_ids": 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["tokens"])
358+
encoded_tokens = encoder_model(inputs["token_ids"])
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

requirements.txt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
black==22.3.1
2-
pygments>=2.7.4
3-
markdown>=3.3
4-
matplotlib
5-
jinja2
6-
requests
7-
mdx_truly_sane_lists
8-
pathlib
9-
PyYAML
10-
pandas
11-
jupyter
12-
tensorflow==2.11.0
13-
tensorflow_datasets
14-
keras-tuner
15-
keras-cv
16-
keras-nlp
1+
black~=22.3.0
2+
pygments>=2.7.4
3+
markdown>=3.3
4+
matplotlib
5+
jinja2
6+
requests
7+
mdx_truly_sane_lists
8+
PyYAML
9+
pandas
10+
jupyter
11+
tensorflow~=2.11.0
12+
tensorflow_datasets
13+
keras-tuner
14+
keras-cv
15+
keras-nlp

0 commit comments

Comments
 (0)