keras-hub-nightly 0.22.0.dev202506170415__py3-none-any.whl → 0.22.0.dev202506190413__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,12 @@ class TransformerEncoder(keras.layers.Layer):
16
16
  paper [Attention is All You Need](https://arxiv.org/abs/1706.03762). Users
17
17
  can instantiate multiple instances of this class to stack up an encoder.
18
18
 
19
- This layer will correctly compute an attention mask from an implicit
20
- Keras padding mask (for example, by passing `mask_zero=True` to a
21
- `keras.layers.Embedding` layer). See the Masking and Padding
19
+ This layer will compute an attention mask, prioritizing explicitly provided
20
+ masks (a `padding_mask` or a custom `attention_mask`) over an implicit Keras
21
+ padding mask (for example, by passing `mask_zero=True` to a
22
+ `keras.layers.Embedding` layer). If both a `padding_mask` and a
23
+ `attention_mask` are provided, they will be combined to determine the final
24
+ mask. See the Masking and Padding
22
25
  [guide](https://keras.io/guides/understanding_masking_and_padding/)
23
26
  for more details.
24
27
 
@@ -48,7 +48,7 @@ class PaliGemmaCausalLM(CausalLM):
48
48
  pali_gemma_lm.generate(
49
49
  {
50
50
  "images": image,
51
- "text": ["answer en where is the cow standing?\\n"]
51
+ "prompts": ["answer en where is the cow standing?\\n"]
52
52
  }
53
53
  )
54
54
 
@@ -56,7 +56,7 @@ class PaliGemmaCausalLM(CausalLM):
56
56
  pali_gemma_lm.generate(
57
57
  {
58
58
  "images": [image, image],
59
- "text": ["answer en where is the cow standing?\\n", "caption en\\n"]
59
+ "prompts": ["answer en where is the cow standing?\\n", "caption en\\n"]
60
60
  }
61
61
  )
62
62
  ```
@@ -299,7 +299,7 @@ class Qwen3Attention(keras.layers.Layer):
299
299
  attention_scores,
300
300
  ops.cast(self._inv_norm_factor, self.compute_dtype),
301
301
  )
302
- if not self.sliding_window_size:
302
+ if self.sliding_window_size:
303
303
  attention_mask = self._mask_sliding_window(
304
304
  attention_mask,
305
305
  cache_update_index=cache_update_index
@@ -1,5 +1,6 @@
1
1
  import collections
2
2
  import datetime
3
+ import glob
3
4
  import inspect
4
5
  import json
5
6
  import os
@@ -317,7 +318,8 @@ def _validate_backbone(preset):
317
318
  )
318
319
 
319
320
  weights_path = os.path.join(preset, MODEL_WEIGHTS_FILE)
320
- if not os.path.exists(weights_path):
321
+ sharded_weights_path = os.path.join(preset, "model_*.weights.h5")
322
+ if not os.path.exists(weights_path) and not glob.glob(sharded_weights_path):
321
323
  raise FileNotFoundError(
322
324
  f"The weights file is missing from the preset directory `{preset}`."
323
325
  )
keras_hub/src/version.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from keras_hub.src.api_export import keras_hub_export
2
2
 
3
3
  # Unique source of truth for the version number.
4
- __version__ = "0.22.0.dev202506170415"
4
+ __version__ = "0.22.0.dev202506190413"
5
5
 
6
6
 
7
7
  @keras_hub_export("keras_hub.version")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keras-hub-nightly
3
- Version: 0.22.0.dev202506170415
3
+ Version: 0.22.0.dev202506190413
4
4
  Summary: Pretrained models for Keras.
5
5
  Author-email: Keras team <keras-users@googlegroups.com>
6
6
  License-Expression: Apache-2.0
@@ -5,7 +5,7 @@ keras_hub/models/__init__.py,sha256=7MhCw7S-uIPcko-R6g5a-Jy1idKe7BwlI836PfekhHc,
5
5
  keras_hub/samplers/__init__.py,sha256=aFQIkiqbZpi8vjrPp2MVII4QUfE-eQjra5fMeHsoy7k,886
6
6
  keras_hub/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  keras_hub/src/api_export.py,sha256=9pQZK27JObxWZ96QPLBp1OBsjWigh1iuV6RglPGMRk0,1499
8
- keras_hub/src/version.py,sha256=aqKaVRKwTfHoj191TVe6s4SnLKcK9G9cIXxCPzQ0ZPs,222
8
+ keras_hub/src/version.py,sha256=hpZsLxPCuYMUHCNKCGUlN2_K9e932CkQVY7nWCBsXB0,222
9
9
  keras_hub/src/layers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  keras_hub/src/layers/modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  keras_hub/src/layers/modeling/alibi_bias.py,sha256=1XBTHI52L_iJDhN_w5ydu_iMhCuTgQAxEPwcLA6BPuk,4411
@@ -22,7 +22,7 @@ keras_hub/src/layers/modeling/rotary_embedding.py,sha256=BuMD2dCyZi73Eokddx8Q9cF
22
22
  keras_hub/src/layers/modeling/sine_position_encoding.py,sha256=NAPW9HaVTMNZgUJNzA3l1B3C_FNvaY7IW-5tQgFgnNg,3453
23
23
  keras_hub/src/layers/modeling/token_and_position_embedding.py,sha256=Q-MhVHZSd_W2eWjDCj-s7wo3z8UHmgZ-7j7hElkaXBQ,5263
24
24
  keras_hub/src/layers/modeling/transformer_decoder.py,sha256=50KLxaZwaQglWIcFotx3BFh6RwCMXRvGZNXHQBrJ5KM,21172
25
- keras_hub/src/layers/modeling/transformer_encoder.py,sha256=Qe19_aR6w4PTFbzvBmSP8-ggiAuOJcgCzaJWcjdzA9c,10625
25
+ keras_hub/src/layers/modeling/transformer_encoder.py,sha256=kKPGfjpdhqGJs4MmRyx7fk9xU_2TAS-gLGhq9FZdU0w,10828
26
26
  keras_hub/src/layers/modeling/transformer_layer_utils.py,sha256=FuznrW33iG50B-VDN8R1RjuA5JG72yNMJ1TBgWLxR0E,3487
27
27
  keras_hub/src/layers/preprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  keras_hub/src/layers/preprocessing/audio_converter.py,sha256=YGh_kQw65a1Z6S5zzSNVP-ChyLYHq3-eOYpOS53xIN8,4156
@@ -294,7 +294,7 @@ keras_hub/src/models/opt/opt_presets.py,sha256=LrjgI5gbq4Cvfl_pmeCnKn4hS_V_0GYTe
294
294
  keras_hub/src/models/opt/opt_tokenizer.py,sha256=oDHeed4xf07tm14hj_C78BkzMuuRwRP2cRHmqYnObrs,2557
295
295
  keras_hub/src/models/pali_gemma/__init__.py,sha256=uODWTlttOOchcTLpiYHCEWMXnDxIz8ZVIeYFQN2bd8o,288
296
296
  keras_hub/src/models/pali_gemma/pali_gemma_backbone.py,sha256=e1KAg4bmK1PrmYW-Ewx3vD7S2DlX9K8LmbRwv30VEkA,13643
297
- keras_hub/src/models/pali_gemma/pali_gemma_causal_lm.py,sha256=AViEs6YltUqWnIVo7J02JkXcanBgLSdwZwF56TVr8gc,11345
297
+ keras_hub/src/models/pali_gemma/pali_gemma_causal_lm.py,sha256=aT075qRyFmuo5JwphKkjLt7iJ8BK8NGt-5mqfgIXYqs,11351
298
298
  keras_hub/src/models/pali_gemma/pali_gemma_causal_lm_preprocessor.py,sha256=F57y0fZ0wYYxfGIjfrJc1W9uQpViYFx5bvFjj5CqUbI,4814
299
299
  keras_hub/src/models/pali_gemma/pali_gemma_decoder_block.py,sha256=24ABQ1vGlppV-KfWh0YqJjzM_Lu2GIwvyJ4X2XXie_A,5616
300
300
  keras_hub/src/models/pali_gemma/pali_gemma_image_converter.py,sha256=5yM_jUtrFsWIieiwfFBoP7mtPmQAwywkeLKbd7fhmzk,371
@@ -320,7 +320,7 @@ keras_hub/src/models/qwen/qwen_decoder.py,sha256=utmAvZlU7_nP-6pjGPDinK4JaMzsQSw
320
320
  keras_hub/src/models/qwen/qwen_layernorm.py,sha256=DS35r3qd6g5ocL7Nhf_vNzLLMo1aI9VCSmL64dgNOYI,924
321
321
  keras_hub/src/models/qwen/qwen_presets.py,sha256=1FkKV6M3yqJz4EP1xa7bEvfIQ721xXT-_ikjWX0xvww,1992
322
322
  keras_hub/src/models/qwen/qwen_tokenizer.py,sha256=LCv3IyiDDHqVnM9N3lf5-BE3iwicIh0nKS1hjoPw9lE,1532
323
- keras_hub/src/models/qwen3/qwen3_attention.py,sha256=sewLjli290XvJ1efGZJEAYqUZfRll7cmhu0258s4C48,13042
323
+ keras_hub/src/models/qwen3/qwen3_attention.py,sha256=mq2Tak0PTItkNi5LnYVcNznS61D2Cdz1-9a-WC7Vw68,13038
324
324
  keras_hub/src/models/qwen3/qwen3_backbone.py,sha256=Ylpk_rRWWRxy8irlAPjJU-YrxYGpo8c9lSEO1zZl4gU,7456
325
325
  keras_hub/src/models/qwen3/qwen3_causal_lm_preprocessor.py,sha256=H4g-bgvuhAUnDwjJovydK16Kes38ZFZWPvflrgHqZis,458
326
326
  keras_hub/src/models/qwen3/qwen3_decoder.py,sha256=68s9jQj53zFmXE4-SGXKYHu546fXOyi9LUbnKk-HGYY,11595
@@ -482,7 +482,7 @@ keras_hub/src/tokenizers/word_piece_tokenizer_trainer.py,sha256=cylrs02ZrYQ1TuZr
482
482
  keras_hub/src/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
483
483
  keras_hub/src/utils/keras_utils.py,sha256=2qrh4F-rqceVFSx0-cbsFBfWae5hBXFb_sEtPPcImf4,4628
484
484
  keras_hub/src/utils/pipeline_model.py,sha256=jgzB6NQPSl0KOu08N-TazfOnXnUJbZjH2EXXhx25Ftg,9084
485
- keras_hub/src/utils/preset_utils.py,sha256=p1N62tK0H_z-WH9XWcpq0UPEkd4po59LvcE2k-KVg1Y,34853
485
+ keras_hub/src/utils/preset_utils.py,sha256=GKYFKK9YcdIrMm0_hC_KTIXgpiMYD6SauMnSRpNsDQo,34975
486
486
  keras_hub/src/utils/python_utils.py,sha256=N8nWeO3san4YnGkffRXG3Ix7VEIMTKSN21FX5TuL7G8,202
487
487
  keras_hub/src/utils/tensor_utils.py,sha256=WrohV6-hvxtLE6rRRhtN4hy8GkHikV-NrRnVEYUwJQo,16133
488
488
  keras_hub/src/utils/coco/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -517,7 +517,7 @@ keras_hub/src/utils/transformers/preset_loader.py,sha256=K5FzDAtCuXS9rmZc0Zj7UCw
517
517
  keras_hub/src/utils/transformers/safetensor_utils.py,sha256=CYUHyA4y-B61r7NDnCsFb4t_UmSwZ1k9L-8gzEd6KRg,3339
518
518
  keras_hub/tokenizers/__init__.py,sha256=uMjjm0mzUkRb0e4Ac_JK8aJ9cKGUi5UqmzWoWAFJprE,4164
519
519
  keras_hub/utils/__init__.py,sha256=jXPqVGBpJr_PpYmqD8aDG-fRMlxH-ulqCR2SZMn288Y,646
520
- keras_hub_nightly-0.22.0.dev202506170415.dist-info/METADATA,sha256=iVujX8QDS3ZBEO3R7iU4WfhqfkXVVXk39_GbDGkLZPw,7393
521
- keras_hub_nightly-0.22.0.dev202506170415.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
522
- keras_hub_nightly-0.22.0.dev202506170415.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
523
- keras_hub_nightly-0.22.0.dev202506170415.dist-info/RECORD,,
520
+ keras_hub_nightly-0.22.0.dev202506190413.dist-info/METADATA,sha256=aeqbPu3SMybWNG4VWxkrFr3sWR4IhshHN5wJCLfJ4mQ,7393
521
+ keras_hub_nightly-0.22.0.dev202506190413.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
522
+ keras_hub_nightly-0.22.0.dev202506190413.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
523
+ keras_hub_nightly-0.22.0.dev202506190413.dist-info/RECORD,,