Skip to content

Commit d29470d

Browse files
ConchylicultorThe gemma Authors
authored andcommitted
Fix numpy 2 compatibility
PiperOrigin-RevId: 725567326
1 parent 0e93e8e commit d29470d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gemma/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
# A new PyPI release will be pushed every time `__version__` is increased.
1818
# When changing this, also update the CHANGELOG.md.
19-
__version__ = '2.0.5'
19+
__version__ = '2.0.6'

gemma/gm/data/_functional.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ def make_next_token_prediction_fields(
9999
The input, target and mask, all of length `prompt_len + response_len - 1`.
100100
"""
101101
# Concatenate the prompt and response tokens.
102-
sequence = np.concat([prompt, response])
102+
sequence = np.concatenate([prompt, response])
103103

104104
# Create the loss mask.
105-
target_mask = np.concat([
106-
np.zeros((len(prompt) - 1,), dtype=np.bool),
107-
np.ones((len(response),), dtype=np.bool),
105+
target_mask = np.concatenate([
106+
np.zeros((len(prompt) - 1,), dtype=np.bool_),
107+
np.ones((len(response),), dtype=np.bool_),
108108
])
109109

110110
return NextTokenPredictionFields(

0 commit comments

Comments
 (0)