keras-hub-nightly 0.20.0.dev202503300400__py3-none-any.whl → 0.20.0.dev202504010407__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.
@@ -369,6 +369,9 @@ from keras_hub.src.models.text_classifier_preprocessor import (
369
369
  TextClassifierPreprocessor,
370
370
  )
371
371
  from keras_hub.src.models.text_to_image import TextToImage
372
+ from keras_hub.src.models.text_to_image_preprocessor import (
373
+ TextToImagePreprocessor,
374
+ )
372
375
  from keras_hub.src.models.vgg.vgg_backbone import VGGBackbone
373
376
  from keras_hub.src.models.vgg.vgg_image_classifier import VGGImageClassifier
374
377
  from keras_hub.src.models.vgg.vgg_image_classifier_preprocessor import (
@@ -2,14 +2,16 @@ import keras
2
2
  from keras import layers
3
3
 
4
4
  from keras_hub.src.api_export import keras_hub_export
5
- from keras_hub.src.models.preprocessor import Preprocessor
6
5
  from keras_hub.src.models.stable_diffusion_3.stable_diffusion_3_backbone import ( # noqa: E501
7
6
  StableDiffusion3Backbone,
8
7
  )
8
+ from keras_hub.src.models.text_to_image_preprocessor import (
9
+ TextToImagePreprocessor,
10
+ )
9
11
 
10
12
 
11
13
  @keras_hub_export("keras_hub.models.StableDiffusion3TextToImagePreprocessor")
12
- class StableDiffusion3TextToImagePreprocessor(Preprocessor):
14
+ class StableDiffusion3TextToImagePreprocessor(TextToImagePreprocessor):
13
15
  """Stable Diffusion 3 text-to-image model preprocessor.
14
16
 
15
17
  This preprocessing layer is meant for use with
@@ -0,0 +1,35 @@
1
+ from keras_hub.src.api_export import keras_hub_export
2
+ from keras_hub.src.models.preprocessor import Preprocessor
3
+
4
+
5
+ @keras_hub_export("keras_hub.models.TextToImagePreprocessor")
6
+ class TextToImagePreprocessor(Preprocessor):
7
+ """Base class for text to image preprocessing layers.
8
+
9
+ `TextToImagePreprocessor` tasks wrap a `keras_hub.tokenizer.Tokenizer` to
10
+ create a preprocessing layer for text to image tasks. It is intended to be
11
+ paired with a `keras_hub.models.TextToImage` task.
12
+
13
+ The exact specifics of this layer will vary depending on the subclass
14
+ implementation per model architecture. Generally, it will take text input,
15
+ and tokenize, then pad/truncate so it is ready to be fed to a image
16
+ generation model (e.g. a diffusion model).
17
+
18
+ Examples.
19
+ ```python
20
+ preprocessor = keras_hub.models.TextToImagePreprocessor.from_preset(
21
+ "stable_diffusion_3_medium",
22
+ sequence_length=256, # Optional.
23
+ )
24
+
25
+ # Tokenize and pad/truncate a single sentence.
26
+ x = "The quick brown fox jumped."
27
+ x = preprocessor(x)
28
+
29
+ # Tokenize and pad/truncate a batch of sentences.
30
+ x = ["The quick brown fox jumped."]
31
+ x = preprocessor(x)
32
+ ```
33
+ """
34
+
35
+ pass
@@ -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.20.0.dev202503300400"
4
+ __version__ = "0.20.0.dev202504010407"
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.20.0.dev202503300400
3
+ Version: 0.20.0.dev202504010407
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=cALDY20DHCVjJDKCD84zHvTZtAgz0xEvozk7a3Cl1Uk,3719
4
4
  keras_hub/api/metrics/__init__.py,sha256=So8Ec-lOcTzn_UUMmAdzDm8RKkPu2dbRUm2px8gpUEI,381
5
- keras_hub/api/models/__init__.py,sha256=yHFQvK1rwOXwsQ6sQB8G-xWrsD7-fzOxylwJdUxAd2M,18632
5
+ keras_hub/api/models/__init__.py,sha256=Ml8AQyMz9VKuLGEjKKQzlIDNScIaoCYmlgH-Zfk4Jxo,18725
6
6
  keras_hub/api/samplers/__init__.py,sha256=n-_SEXxr2LNUzK2FqVFN7alsrkx1P_HOVTeLZKeGCdE,730
7
7
  keras_hub/api/tokenizers/__init__.py,sha256=TOTM3he5JWPME_4e29_S1nrWibTHomcuuKQ4KarqUNo,2831
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=p5bVSww29nJU8ZGaxsD1p7PSLp1FSiJ1nxTgPv98wBQ,222
11
+ keras_hub/src/version_utils.py,sha256=OsUwPWPZpPCMjDiiDuMytzPQ_fmJixCqlxXypU5TQGg,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
@@ -65,6 +65,7 @@ keras_hub/src/models/task.py,sha256=a7eW8ylmsSY4opI5bEo_AQQOXBgsGU5CihQWm1DWfnw,
65
65
  keras_hub/src/models/text_classifier.py,sha256=B6cTYDbDZW8vRvenXrLwgMMVIYMb7Pr14GvX8C_wclQ,4159
66
66
  keras_hub/src/models/text_classifier_preprocessor.py,sha256=EoWp-GHnaLnAKTdAzDmC-soAV92ATF3QozdubdV2WXI,4722
67
67
  keras_hub/src/models/text_to_image.py,sha256=NIy4S6Fh8MsbNiskAFhjmFXgRiiFqn_rOvpGOO6LlF0,13390
68
+ keras_hub/src/models/text_to_image_preprocessor.py,sha256=SKMxEABl5sy1QIA3irHTZKs7VgMdx9Cxy4IaxDU6faM,1211
68
69
  keras_hub/src/models/albert/__init__.py,sha256=rR6q_-8FujB1FXp6r4KOI7xi4gFjtAhQwXjp-MIhiyg,257
69
70
  keras_hub/src/models/albert/albert_backbone.py,sha256=4NQFo8lhv8rFiNIwQeZxxKxFwT3nKcCt36FUa6oPGok,10073
70
71
  keras_hub/src/models/albert/albert_masked_lm.py,sha256=jG6FttE_MAyBe8GzOEXMjEem3wo6UFGvxM3lRmXuS70,4126
@@ -348,7 +349,7 @@ keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_image_to_image.py,sha
348
349
  keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_inpaint.py,sha256=t4uw920Jn1k80air3WRGimKf71aMVu6q73oWFH348vk,6384
349
350
  keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_presets.py,sha256=x7Ez4L955MJE4ABtBy-63YpU9XpR0Ro8QWPzYYJs1yE,2167
350
351
  keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image.py,sha256=Yt-UIatVKANjjKFCFEj1rIHhOrt8hqefKKQJIAWcTLc,4567
351
- keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image_preprocessor.py,sha256=m5PdVSgTcYuqd7jOQ8wD4PAnMa7wY2WdhwpK3hdydhM,2756
352
+ keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image_preprocessor.py,sha256=sQvrhuWvC4hM99cxFiI5532QLeiW4YXpH0zAvnnCXQA,2801
352
353
  keras_hub/src/models/stable_diffusion_3/t5_encoder.py,sha256=oV7P1uwCKdGiD93zXq7kmqX0elMZQU4UvBa8wg6P1hs,5113
353
354
  keras_hub/src/models/t5/__init__.py,sha256=OWyoUeDY3v4DnO8Ry02DWV1bNSVGcC89PF9oCftyi1s,233
354
355
  keras_hub/src/models/t5/t5_backbone.py,sha256=MUmabugPx5_BkAHkuJXr2-8z_yZfKD19SO0KJtlcHhA,10331
@@ -448,7 +449,7 @@ keras_hub/src/utils/transformers/convert_qwen.py,sha256=I2bfwo8AQd_JfwFpiAuCQ3k_
448
449
  keras_hub/src/utils/transformers/convert_vit.py,sha256=9SUZ9utNJhW_5cj3acMn9cRy47u2eIcDsrhmzj77o9k,5187
449
450
  keras_hub/src/utils/transformers/preset_loader.py,sha256=0Hi7R8HnATcwFVLsJwMMIMWTCXHNfep4IPiRpQXqM-w,3933
450
451
  keras_hub/src/utils/transformers/safetensor_utils.py,sha256=CYUHyA4y-B61r7NDnCsFb4t_UmSwZ1k9L-8gzEd6KRg,3339
451
- keras_hub_nightly-0.20.0.dev202503300400.dist-info/METADATA,sha256=tTu4KkXYcJ1JJ-EOip3C-f7Td5yQ71vf9r8ZvZrWUBs,7715
452
- keras_hub_nightly-0.20.0.dev202503300400.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
453
- keras_hub_nightly-0.20.0.dev202503300400.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
454
- keras_hub_nightly-0.20.0.dev202503300400.dist-info/RECORD,,
452
+ keras_hub_nightly-0.20.0.dev202504010407.dist-info/METADATA,sha256=77ncA8nPcUGWqFtGIA4EPqrK6BdhNskTR3vDrTVWaLU,7715
453
+ keras_hub_nightly-0.20.0.dev202504010407.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
454
+ keras_hub_nightly-0.20.0.dev202504010407.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
455
+ keras_hub_nightly-0.20.0.dev202504010407.dist-info/RECORD,,