keras-hub-nightly 0.21.0.dev202504080400__py3-none-any.whl → 0.21.0.dev202504100401__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.
@@ -276,6 +276,24 @@ from keras_hub.src.models.phi3.phi3_causal_lm_preprocessor import (
276
276
  )
277
277
  from keras_hub.src.models.phi3.phi3_tokenizer import Phi3Tokenizer
278
278
  from keras_hub.src.models.preprocessor import Preprocessor
279
+ from keras_hub.src.models.qwen.qwen_backbone import QwenBackbone
280
+ from keras_hub.src.models.qwen.qwen_backbone import (
281
+ QwenBackbone as Qwen2Backbone,
282
+ )
283
+ from keras_hub.src.models.qwen.qwen_causal_lm import QwenCausalLM
284
+ from keras_hub.src.models.qwen.qwen_causal_lm import (
285
+ QwenCausalLM as Qwen2CausalLM,
286
+ )
287
+ from keras_hub.src.models.qwen.qwen_causal_lm_preprocessor import (
288
+ QwenCausalLMPreprocessor,
289
+ )
290
+ from keras_hub.src.models.qwen.qwen_causal_lm_preprocessor import (
291
+ QwenCausalLMPreprocessor as Qwen2CausalLMPreprocessor,
292
+ )
293
+ from keras_hub.src.models.qwen.qwen_tokenizer import QwenTokenizer
294
+ from keras_hub.src.models.qwen.qwen_tokenizer import (
295
+ QwenTokenizer as Qwen2Tokenizer,
296
+ )
279
297
  from keras_hub.src.models.resnet.resnet_backbone import ResNetBackbone
280
298
  from keras_hub.src.models.resnet.resnet_image_classifier import (
281
299
  ResNetImageClassifier,
@@ -30,6 +30,10 @@ from keras_hub.src.models.pali_gemma.pali_gemma_tokenizer import (
30
30
  PaliGemmaTokenizer,
31
31
  )
32
32
  from keras_hub.src.models.phi3.phi3_tokenizer import Phi3Tokenizer
33
+ from keras_hub.src.models.qwen.qwen_tokenizer import QwenTokenizer
34
+ from keras_hub.src.models.qwen.qwen_tokenizer import (
35
+ QwenTokenizer as Qwen2Tokenizer,
36
+ )
33
37
  from keras_hub.src.models.roberta.roberta_tokenizer import RobertaTokenizer
34
38
  from keras_hub.src.models.roformer_v2.roformer_v2_tokenizer import (
35
39
  RoformerV2Tokenizer,
@@ -488,7 +488,7 @@ class Gemma3VisionEncoderBlock(keras.layers.Layer):
488
488
  # Fix the compatibility issue with Keras 3.1 where
489
489
  # `compute_output_spec` fails to propagate `inputs_shape`
490
490
  # correctly, causing it to be `None`.
491
- inputs_shape = [None, None, None]
491
+ return [None, None, self.hidden_dim]
492
492
  return [
493
493
  None,
494
494
  (inputs_shape[2] // self.patch_size) ** 2,
@@ -329,7 +329,7 @@ class PaliGemmaVitEncoder(keras.layers.Layer):
329
329
  # Fix the compatibility issue with Keras 3.1 where
330
330
  # `compute_output_spec` fails to propagate `inputs_shape`
331
331
  # correctly, causing it to be `None`.
332
- inputs_shape = [None, None, None]
332
+ return [None, None, self.hidden_dim]
333
333
  return [
334
334
  inputs_shape[0],
335
335
  (inputs_shape[1] // self.patch_size) ** 2,
@@ -1,6 +1,7 @@
1
1
  import keras
2
2
  from keras import ops
3
3
 
4
+ from keras_hub.src.api_export import keras_hub_export
4
5
  from keras_hub.src.layers.modeling.reversible_embedding import (
5
6
  ReversibleEmbedding,
6
7
  )
@@ -13,6 +14,12 @@ def _qwen_kernel_initializer(stddev=0.02):
13
14
  return keras.initializers.RandomNormal(stddev=stddev)
14
15
 
15
16
 
17
+ @keras_hub_export(
18
+ [
19
+ "keras_hub.models.QwenBackbone",
20
+ "keras_hub.models.Qwen2Backbone",
21
+ ]
22
+ )
16
23
  class QwenBackbone(Backbone):
17
24
  """
18
25
  The Qwen Transformer core architecture with hyperparameters.
@@ -1,6 +1,7 @@
1
1
  import keras
2
2
  from keras import ops
3
3
 
4
+ from keras_hub.src.api_export import keras_hub_export
4
5
  from keras_hub.src.models.causal_lm import CausalLM
5
6
  from keras_hub.src.models.qwen.qwen_backbone import QwenBackbone
6
7
  from keras_hub.src.models.qwen.qwen_causal_lm_preprocessor import (
@@ -9,6 +10,12 @@ from keras_hub.src.models.qwen.qwen_causal_lm_preprocessor import (
9
10
  from keras_hub.src.utils.tensor_utils import any_equal
10
11
 
11
12
 
13
+ @keras_hub_export(
14
+ [
15
+ "keras_hub.models.QwenCausalLM",
16
+ "keras_hub.models.Qwen2CausalLM",
17
+ ]
18
+ )
12
19
  class QwenCausalLM(CausalLM):
13
20
  backbone_cls = QwenBackbone
14
21
  preprocessor_cls = QwenCausalLMPreprocessor
@@ -1,8 +1,15 @@
1
+ from keras_hub.src.api_export import keras_hub_export
1
2
  from keras_hub.src.models.causal_lm_preprocessor import CausalLMPreprocessor
2
3
  from keras_hub.src.models.qwen.qwen_backbone import QwenBackbone
3
4
  from keras_hub.src.models.qwen.qwen_tokenizer import QwenTokenizer
4
5
 
5
6
 
7
+ @keras_hub_export(
8
+ [
9
+ "keras_hub.models.QwenCausalLMPreprocessor",
10
+ "keras_hub.models.Qwen2CausalLMPreprocessor",
11
+ ]
12
+ )
6
13
  class QwenCausalLMPreprocessor(CausalLMPreprocessor):
7
14
  backbone_cls = QwenBackbone
8
15
  tokenizer_cls = QwenTokenizer
@@ -1,7 +1,16 @@
1
+ from keras_hub.src.api_export import keras_hub_export
1
2
  from keras_hub.src.models.qwen.qwen_backbone import QwenBackbone
2
3
  from keras_hub.src.tokenizers.byte_pair_tokenizer import BytePairTokenizer
3
4
 
4
5
 
6
+ @keras_hub_export(
7
+ [
8
+ "keras_hub.tokenizers.QwenTokenizer",
9
+ "keras_hub.tokenizers.Qwen2Tokenizer",
10
+ "keras_hub.models.QwenTokenizer",
11
+ "keras_hub.models.Qwen2Tokenizer",
12
+ ]
13
+ )
5
14
  class QwenTokenizer(BytePairTokenizer):
6
15
  """Tokenizer for Qwen models.
7
16
 
@@ -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.21.0.dev202504080400"
4
+ __version__ = "0.21.0.dev202504100401"
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.21.0.dev202504080400
3
+ Version: 0.21.0.dev202504100401
4
4
  Summary: Industry-strength Natural Language Processing extensions for Keras.
5
5
  Home-page: https://github.com/keras-team/keras-hub
6
6
  Author: Keras team
@@ -2,13 +2,13 @@ keras_hub/__init__.py,sha256=QGdXyHgYt6cMUAP1ebxwc6oR86dE0dkMxNy2eOCQtFo,855
2
2
  keras_hub/api/__init__.py,sha256=EzR6D-XWsm_gDrX5LDwKEmrah_gu3ffpj8GKBudE0yI,485
3
3
  keras_hub/api/layers/__init__.py,sha256=MXQbQ0PpkDDRmP7A38aHjF6V2WilFlOxqUx4psoyvFo,3818
4
4
  keras_hub/api/metrics/__init__.py,sha256=So8Ec-lOcTzn_UUMmAdzDm8RKkPu2dbRUm2px8gpUEI,381
5
- keras_hub/api/models/__init__.py,sha256=Um3TlN6BfFBC2kLJvAbiQ3PwUaZk0yhq4yQWttxsH1o,19060
5
+ keras_hub/api/models/__init__.py,sha256=G0p58akoeEjmmkRdGpO_LSJ3DRTurLFmClRyZ4qzdgM,19764
6
6
  keras_hub/api/samplers/__init__.py,sha256=n-_SEXxr2LNUzK2FqVFN7alsrkx1P_HOVTeLZKeGCdE,730
7
- keras_hub/api/tokenizers/__init__.py,sha256=ZMrudLg7bR9_ZoXJbiUEU3J6NHBqFRjKqLlfGrIWewo,2766
7
+ keras_hub/api/tokenizers/__init__.py,sha256=NCQSOg3vf3KlM2YBsxApcJUVu9MH2jV0NQrM3f4EhJ4,2927
8
8
  keras_hub/api/utils/__init__.py,sha256=Gp1E6gG-RtKQS3PBEQEOz9PQvXkXaJ0ySGMqZ7myN7A,215
9
9
  keras_hub/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  keras_hub/src/api_export.py,sha256=9pQZK27JObxWZ96QPLBp1OBsjWigh1iuV6RglPGMRk0,1499
11
- keras_hub/src/version_utils.py,sha256=VsNlPU0eVPO3YizbjUQR1xHevKnzkfuXQTKW5zfpTMs,222
11
+ keras_hub/src/version_utils.py,sha256=6r8sjXn37MNBzXo9aUmSlLqmM-B5N5uKaNTjCFRDEhY,222
12
12
  keras_hub/src/layers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  keras_hub/src/layers/modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  keras_hub/src/layers/modeling/alibi_bias.py,sha256=1XBTHI52L_iJDhN_w5ydu_iMhCuTgQAxEPwcLA6BPuk,4411
@@ -205,7 +205,7 @@ keras_hub/src/models/gemma3/gemma3_image_converter.py,sha256=czi5JrTyKiK0nFzvonv
205
205
  keras_hub/src/models/gemma3/gemma3_interleave_embeddings.py,sha256=_Q5hvhA93HAJe-A2IBRKVu0_RDVht61lFQiYse_9Rm4,4597
206
206
  keras_hub/src/models/gemma3/gemma3_presets.py,sha256=--V8AV9VLk8GJ9JmyVAfZfSPe_d_p0L60bdyED04ig0,5124
207
207
  keras_hub/src/models/gemma3/gemma3_tokenizer.py,sha256=ZaBclFIwzJkSXDuZMBQLHUKV8RWEdZ_dsJMvMcc3qXw,3215
208
- keras_hub/src/models/gemma3/gemma3_vision_encoder.py,sha256=h4i-C9JfSjZhC0DWZiFSXSvX009aeV1SsfogYqfyP9Y,20847
208
+ keras_hub/src/models/gemma3/gemma3_vision_encoder.py,sha256=7XI0oBjIfJItV5w90t5bWb3C2KzjhvDnIC7wjIq4Cns,20850
209
209
  keras_hub/src/models/gemma3/rms_normalization.py,sha256=fku-JEo2sNy-ytX7ySD1sRzdhRAPmYex_z8oFk1NiG8,833
210
210
  keras_hub/src/models/gpt2/__init__.py,sha256=_hqeljpBkW8DLABy4nKBzJxXUh29WIEW27obmDCiH5Q,245
211
211
  keras_hub/src/models/gpt2/gpt2_backbone.py,sha256=H1LgDd-bavrWtdCavdI519qlaruE2Jj5H3-SMc-5d14,6961
@@ -273,7 +273,7 @@ keras_hub/src/models/pali_gemma/pali_gemma_decoder_block.py,sha256=24ABQ1vGlppV-
273
273
  keras_hub/src/models/pali_gemma/pali_gemma_image_converter.py,sha256=5yM_jUtrFsWIieiwfFBoP7mtPmQAwywkeLKbd7fhmzk,371
274
274
  keras_hub/src/models/pali_gemma/pali_gemma_presets.py,sha256=zF04iShXky_c3IfUbmLlBN2FYb6iCWH1DWTgDdTCqrI,13006
275
275
  keras_hub/src/models/pali_gemma/pali_gemma_tokenizer.py,sha256=ljTiADHo0Ok88q-jVzwJIle2C8xcxnudLTsBLzIySaM,2415
276
- keras_hub/src/models/pali_gemma/pali_gemma_vit.py,sha256=mwzhdo6wjemOjic4p6vECMlScxyI_meXMWBZ76YlblE,18308
276
+ keras_hub/src/models/pali_gemma/pali_gemma_vit.py,sha256=SbWanwCoONSwgiWQsc6lFdvhqKZ-zDW42XzQt8CNMtU,18311
277
277
  keras_hub/src/models/phi3/__init__.py,sha256=zIbf1MU-ks91mEkjTRJAsk51N3BBnXDF2JM1vO-13PQ,245
278
278
  keras_hub/src/models/phi3/phi3_attention.py,sha256=pojx23rG2NPqy0MRo_OspnxipJCZvexZ2V25xucimHY,9980
279
279
  keras_hub/src/models/phi3/phi3_backbone.py,sha256=fY-OY2ZrqxDHglYjTM0OCacBdEQHwj-XNmU0MnXL7iU,8885
@@ -286,12 +286,12 @@ keras_hub/src/models/phi3/phi3_rotary_embedding.py,sha256=wqiRn8nETNcLc5Vsm_d_8s
286
286
  keras_hub/src/models/phi3/phi3_tokenizer.py,sha256=bOPH14wTVVHJHq8mgzXLjsgvKMNhfO8eayevAPpjYVA,1992
287
287
  keras_hub/src/models/qwen/__init__.py,sha256=hskG3tZUY_AYZPp0WVzbCtw37AIYENyp3DOnqHmdRBw,65
288
288
  keras_hub/src/models/qwen/qwen_attention.py,sha256=FL_09-eCFugktDNzFPm6beZLD04pNg9TFKgfXdhWUwk,12953
289
- keras_hub/src/models/qwen/qwen_backbone.py,sha256=e9AR-7z7Wxn-Lbk3dk5MXUNJ1N8ykO9Tt-RVdLBlU3o,12845
290
- keras_hub/src/models/qwen/qwen_causal_lm.py,sha256=TuGpp9EXkEMQLJ0XybRuOkUl_g-v0Bq-Vdfcw6JkjC0,12079
291
- keras_hub/src/models/qwen/qwen_causal_lm_preprocessor.py,sha256=pozIzd5bDgMvaYw13HBM5eKV8VBdg91_HzctnTultLg,415
289
+ keras_hub/src/models/qwen/qwen_backbone.py,sha256=i39_LoKu6hcYWV6KFh2OzUDaXjV7g1WLNGF2-JD_tqI,13015
290
+ keras_hub/src/models/qwen/qwen_causal_lm.py,sha256=_f-UHaKHp0ncxknpkpEJiW3jlng3E4CmddjQfz2QzJo,12249
291
+ keras_hub/src/models/qwen/qwen_causal_lm_preprocessor.py,sha256=Va-4TLJD3ycEnkS41rF3dVj4_6K0j-gxLTrREFRcyr0,609
292
292
  keras_hub/src/models/qwen/qwen_decoder.py,sha256=utmAvZlU7_nP-6pjGPDinK4JaMzsQSwOARG0ote-jAg,11771
293
293
  keras_hub/src/models/qwen/qwen_layernorm.py,sha256=DS35r3qd6g5ocL7Nhf_vNzLLMo1aI9VCSmL64dgNOYI,924
294
- keras_hub/src/models/qwen/qwen_tokenizer.py,sha256=mQaxfHOthH2QtzaeSfVKyMSXNTTVIdUhAQrrIphD2ys,1267
294
+ keras_hub/src/models/qwen/qwen_tokenizer.py,sha256=LCv3IyiDDHqVnM9N3lf5-BE3iwicIh0nKS1hjoPw9lE,1532
295
295
  keras_hub/src/models/resnet/__init__.py,sha256=C5UqlQ6apm8WSp1bnrxB6Bi3BGaknxRQs-r3b2wpaGA,257
296
296
  keras_hub/src/models/resnet/resnet_backbone.py,sha256=Q7nlqcTXZzjqd0e-DsjHC4ok58yOX7qxseotym3uZpM,31276
297
297
  keras_hub/src/models/resnet/resnet_image_classifier.py,sha256=nf35EKDzvBkfhHsK-s6Ks0nbhvKO7HEOYZm94YckyWE,510
@@ -465,7 +465,7 @@ keras_hub/src/utils/transformers/convert_qwen.py,sha256=WUxMAEFVqRs7TRw7QU5TH3_e
465
465
  keras_hub/src/utils/transformers/convert_vit.py,sha256=9SUZ9utNJhW_5cj3acMn9cRy47u2eIcDsrhmzj77o9k,5187
466
466
  keras_hub/src/utils/transformers/preset_loader.py,sha256=0Hi7R8HnATcwFVLsJwMMIMWTCXHNfep4IPiRpQXqM-w,3933
467
467
  keras_hub/src/utils/transformers/safetensor_utils.py,sha256=CYUHyA4y-B61r7NDnCsFb4t_UmSwZ1k9L-8gzEd6KRg,3339
468
- keras_hub_nightly-0.21.0.dev202504080400.dist-info/METADATA,sha256=kWViDVDVTe3wfloTvcO7fDTI0khukSly-7VMNQRIoRs,7715
469
- keras_hub_nightly-0.21.0.dev202504080400.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
470
- keras_hub_nightly-0.21.0.dev202504080400.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
471
- keras_hub_nightly-0.21.0.dev202504080400.dist-info/RECORD,,
468
+ keras_hub_nightly-0.21.0.dev202504100401.dist-info/METADATA,sha256=O9QRUKo-dmlzHiB2SlkFz2ttq1DH6c8TZpXZuqofJ8U,7715
469
+ keras_hub_nightly-0.21.0.dev202504100401.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
470
+ keras_hub_nightly-0.21.0.dev202504100401.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
471
+ keras_hub_nightly-0.21.0.dev202504100401.dist-info/RECORD,,