Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [created]
jobs:
build:
name: Test the code with tf.keras
name: Test the code with Keras 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +29,8 @@ jobs:
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off
pip install -r requirements-common.txt --progress-bar off
pip install tensorflow-text==2.14 tensorflow==2.14 keras-core
pip install --no-deps -e "." --progress-bar off
- name: Test with pytest
run: |
Expand All @@ -38,7 +39,7 @@ jobs:
run: |
python pip_build.py --install && cd integration_tests && pytest .
multibackend:
name: Test the code with Keras Core
name: Test the code with Keras 3
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 3 additions & 0 deletions keras_nlp/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def _check_for_loss_mismatch(self, loss):
)

def compile(self, optimizer="rmsprop", loss=None, **kwargs):
# Temporarily disable jit compilation on torch.
if config.backend() == "torch":
kwargs["jit_compile"] = False
self._check_for_loss_mismatch(loss)
super().compile(optimizer=optimizer, loss=loss, **kwargs)

Expand Down
4 changes: 3 additions & 1 deletion keras_nlp/tests/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def call(self, x):
return self.layer(x)

model = TestModel(layer)
model.compile(optimizer="sgd", loss="mse", jit_compile=True)
# Temporarily disable jit compilation on torch backend.
jit_compile = config.backend() != "torch"
model.compile(optimizer="sgd", loss="mse", jit_compile=jit_compile)
model.fit(input_data, output_data, verbose=0)

if config.multi_backend():
Expand Down
3 changes: 0 additions & 3 deletions requirements-common.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Library deps.
keras-core>=0.1.6
dm-tree
regex
rich
Expand All @@ -17,5 +16,3 @@ namex
rouge-score
sentencepiece
tensorflow-datasets
# Breakage fix.
ml-dtypes==0.2.0
4 changes: 2 additions & 2 deletions requirements-jax-cuda.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tensorflow cpu-only version.
tensorflow>=2.14.0
tensorflow-text>=2.14.0
tf-nightly-cpu==2.16.0.dev20231103 # Pin a working nightly until rc0.
tensorflow-text-nightly==2.16.0.dev20231103 # Pin a working nightly until rc0.

# Torch cpu-only version.
--extra-index-url https://download.pytorch.org/whl/cpu
Expand Down
5 changes: 3 additions & 2 deletions requirements-tensorflow-cuda.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tensorflow with cuda support.
tensorflow[and-cuda]>=2.14.0
tensorflow-text>=2.14.0
--extra-index-url https://pypi.nvidia.com
tf-nightly[and-cuda]==2.16.0.dev20231103 # Pin a working nightly until rc0.
tensorflow-text-nightly==2.16.0.dev20231103 # Pin a working nightly until rc0.

# Torch cpu-only version.
--extra-index-url https://download.pytorch.org/whl/cpu
Expand Down
4 changes: 2 additions & 2 deletions requirements-torch-cuda.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tensorflow cpu-only version.
tensorflow>=2.14.0
tensorflow-text>=2.14.0
tf-nightly-cpu==2.16.0.dev20231103 # Pin a working nightly until rc0.
tensorflow-text-nightly==2.16.0.dev20231103 # Pin a working nightly until rc0.

# Torch with cuda support.
--extra-index-url https://download.pytorch.org/whl/cu118
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tensorflow.
tensorflow>=2.14.0
tensorflow-text>=2.14.0
tf-nightly-cpu==2.16.0.dev20231103 # Pin a working nightly until rc0.
tensorflow-text-nightly==2.16.0.dev20231103 # Pin a working nightly until rc0.

# Torch.
--extra-index-url https://download.pytorch.org/whl/cpu
Expand Down