Skip to content

Commit 4cf6586

Browse files
authored
Fixes GPU Test failures for Keras 3 (#1361)
* Update Keras2 to TF 2.15 to align on cuda ver * Set encoding to utf8 for tokenizer
1 parent fd559ed commit 4cf6586

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.kokoro/github/ubuntu/gpu/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ "${KERAS2:-0}" == "1" ]
2525
then
2626
echo "Keras2 detected."
2727
pip install -r requirements-common.txt --progress-bar off
28-
pip install tensorflow-text==2.14 tensorflow==2.14 keras-core
28+
pip install tensorflow-text==2.15 tensorflow[and-cuda]~=2.15 keras-core
2929

3030
elif [ "$KERAS_BACKEND" == "tensorflow" ]
3131
then

.kokoro/github/ubuntu/gpu/keras2/presubmit.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ action {
77
}
88
}
99

10+
env_vars: {
11+
key: "KERAS2"
12+
value: "1"
13+
}
14+
1015
# Set timeout to 60 mins from default 180 mins
1116
timeout_mins: 60

keras_nlp/models/whisper/whisper_tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
def _load_dict(dict_or_path):
2525
if isinstance(dict_or_path, str):
26-
with open(dict_or_path, "r") as f:
26+
with open(dict_or_path, "r", encoding="utf-8") as f:
2727
dict_or_path = json.load(f)
2828
return dict_or_path
2929

keras_nlp/tokenizers/byte_pair_tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def __init__(
292292
super().__init__(dtype=dtype, **kwargs)
293293

294294
if isinstance(vocabulary, str):
295-
with open(vocabulary, "r") as f:
295+
with open(vocabulary, "r", encoding="utf-8") as f:
296296
self.vocabulary = json.load(f)
297297
elif isinstance(vocabulary, dict):
298298
self.vocabulary = vocabulary.copy()

0 commit comments

Comments
 (0)