keras-hub-nightly 0.15.0.dev20240823171555__py3-none-any.whl → 0.16.0.dev2024092017__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.
- keras_hub/__init__.py +0 -6
- keras_hub/api/__init__.py +2 -0
- keras_hub/api/bounding_box/__init__.py +36 -0
- keras_hub/api/layers/__init__.py +14 -0
- keras_hub/api/models/__init__.py +97 -48
- keras_hub/api/tokenizers/__init__.py +30 -0
- keras_hub/api/utils/__init__.py +22 -0
- keras_hub/src/api_export.py +15 -9
- keras_hub/src/bounding_box/__init__.py +13 -0
- keras_hub/src/bounding_box/converters.py +529 -0
- keras_hub/src/bounding_box/formats.py +162 -0
- keras_hub/src/bounding_box/iou.py +263 -0
- keras_hub/src/bounding_box/to_dense.py +95 -0
- keras_hub/src/bounding_box/to_ragged.py +99 -0
- keras_hub/src/bounding_box/utils.py +194 -0
- keras_hub/src/bounding_box/validate_format.py +99 -0
- keras_hub/src/layers/preprocessing/audio_converter.py +121 -0
- keras_hub/src/layers/preprocessing/image_converter.py +130 -0
- keras_hub/src/layers/preprocessing/masked_lm_mask_generator.py +2 -0
- keras_hub/src/layers/preprocessing/multi_segment_packer.py +9 -8
- keras_hub/src/layers/preprocessing/preprocessing_layer.py +2 -29
- keras_hub/src/layers/preprocessing/random_deletion.py +33 -31
- keras_hub/src/layers/preprocessing/random_swap.py +33 -31
- keras_hub/src/layers/preprocessing/resizing_image_converter.py +101 -0
- keras_hub/src/layers/preprocessing/start_end_packer.py +3 -2
- keras_hub/src/models/albert/__init__.py +1 -2
- keras_hub/src/models/albert/albert_masked_lm_preprocessor.py +6 -86
- keras_hub/src/models/albert/{albert_classifier.py → albert_text_classifier.py} +34 -10
- keras_hub/src/models/albert/{albert_preprocessor.py → albert_text_classifier_preprocessor.py} +14 -70
- keras_hub/src/models/albert/albert_tokenizer.py +17 -36
- keras_hub/src/models/backbone.py +12 -34
- keras_hub/src/models/bart/__init__.py +1 -2
- keras_hub/src/models/bart/bart_seq_2_seq_lm_preprocessor.py +21 -148
- keras_hub/src/models/bart/bart_tokenizer.py +12 -39
- keras_hub/src/models/bert/__init__.py +1 -5
- keras_hub/src/models/bert/bert_masked_lm_preprocessor.py +6 -87
- keras_hub/src/models/bert/bert_presets.py +1 -4
- keras_hub/src/models/bert/{bert_classifier.py → bert_text_classifier.py} +19 -12
- keras_hub/src/models/bert/{bert_preprocessor.py → bert_text_classifier_preprocessor.py} +14 -70
- keras_hub/src/models/bert/bert_tokenizer.py +17 -35
- keras_hub/src/models/bloom/__init__.py +1 -2
- keras_hub/src/models/bloom/bloom_causal_lm_preprocessor.py +6 -91
- keras_hub/src/models/bloom/bloom_tokenizer.py +12 -41
- keras_hub/src/models/causal_lm.py +10 -29
- keras_hub/src/models/causal_lm_preprocessor.py +195 -0
- keras_hub/src/models/csp_darknet/csp_darknet_backbone.py +54 -15
- keras_hub/src/models/deberta_v3/__init__.py +1 -4
- keras_hub/src/models/deberta_v3/deberta_v3_masked_lm_preprocessor.py +14 -77
- keras_hub/src/models/deberta_v3/{deberta_v3_classifier.py → deberta_v3_text_classifier.py} +16 -11
- keras_hub/src/models/deberta_v3/{deberta_v3_preprocessor.py → deberta_v3_text_classifier_preprocessor.py} +23 -64
- keras_hub/src/models/deberta_v3/deberta_v3_tokenizer.py +30 -25
- keras_hub/src/models/densenet/densenet_backbone.py +46 -22
- keras_hub/src/models/distil_bert/__init__.py +1 -4
- keras_hub/src/models/distil_bert/distil_bert_masked_lm_preprocessor.py +14 -76
- keras_hub/src/models/distil_bert/{distil_bert_classifier.py → distil_bert_text_classifier.py} +17 -12
- keras_hub/src/models/distil_bert/{distil_bert_preprocessor.py → distil_bert_text_classifier_preprocessor.py} +23 -63
- keras_hub/src/models/distil_bert/distil_bert_tokenizer.py +19 -35
- keras_hub/src/models/efficientnet/__init__.py +13 -0
- keras_hub/src/models/efficientnet/efficientnet_backbone.py +569 -0
- keras_hub/src/models/efficientnet/fusedmbconv.py +229 -0
- keras_hub/src/models/efficientnet/mbconv.py +238 -0
- keras_hub/src/models/electra/__init__.py +1 -2
- keras_hub/src/models/electra/electra_tokenizer.py +17 -32
- keras_hub/src/models/f_net/__init__.py +1 -2
- keras_hub/src/models/f_net/f_net_masked_lm_preprocessor.py +12 -78
- keras_hub/src/models/f_net/{f_net_classifier.py → f_net_text_classifier.py} +17 -10
- keras_hub/src/models/f_net/{f_net_preprocessor.py → f_net_text_classifier_preprocessor.py} +19 -63
- keras_hub/src/models/f_net/f_net_tokenizer.py +17 -35
- keras_hub/src/models/falcon/__init__.py +1 -2
- keras_hub/src/models/falcon/falcon_causal_lm_preprocessor.py +6 -89
- keras_hub/src/models/falcon/falcon_tokenizer.py +12 -35
- keras_hub/src/models/gemma/__init__.py +1 -2
- keras_hub/src/models/gemma/gemma_causal_lm_preprocessor.py +6 -90
- keras_hub/src/models/gemma/gemma_decoder_block.py +1 -1
- keras_hub/src/models/gemma/gemma_tokenizer.py +12 -23
- keras_hub/src/models/gpt2/__init__.py +1 -2
- keras_hub/src/models/gpt2/gpt2_causal_lm_preprocessor.py +6 -89
- keras_hub/src/models/gpt2/gpt2_preprocessor.py +12 -90
- keras_hub/src/models/gpt2/gpt2_tokenizer.py +12 -34
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_causal_lm_preprocessor.py +6 -91
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_tokenizer.py +12 -34
- keras_hub/src/models/image_classifier.py +0 -5
- keras_hub/src/models/image_classifier_preprocessor.py +83 -0
- keras_hub/src/models/llama/__init__.py +1 -2
- keras_hub/src/models/llama/llama_causal_lm_preprocessor.py +6 -85
- keras_hub/src/models/llama/llama_tokenizer.py +12 -25
- keras_hub/src/models/llama3/__init__.py +1 -2
- keras_hub/src/models/llama3/llama3_causal_lm_preprocessor.py +6 -89
- keras_hub/src/models/llama3/llama3_tokenizer.py +12 -33
- keras_hub/src/models/masked_lm.py +0 -2
- keras_hub/src/models/masked_lm_preprocessor.py +156 -0
- keras_hub/src/models/mistral/__init__.py +1 -2
- keras_hub/src/models/mistral/mistral_causal_lm_preprocessor.py +6 -91
- keras_hub/src/models/mistral/mistral_tokenizer.py +12 -23
- keras_hub/src/models/mix_transformer/mix_transformer_backbone.py +2 -2
- keras_hub/src/models/mobilenet/__init__.py +13 -0
- keras_hub/src/models/mobilenet/mobilenet_backbone.py +530 -0
- keras_hub/src/models/mobilenet/mobilenet_image_classifier.py +114 -0
- keras_hub/src/models/opt/__init__.py +1 -2
- keras_hub/src/models/opt/opt_causal_lm_preprocessor.py +6 -93
- keras_hub/src/models/opt/opt_tokenizer.py +12 -41
- keras_hub/src/models/pali_gemma/__init__.py +1 -4
- keras_hub/src/models/pali_gemma/pali_gemma_causal_lm_preprocessor.py +28 -28
- keras_hub/src/models/pali_gemma/pali_gemma_image_converter.py +25 -0
- keras_hub/src/models/pali_gemma/pali_gemma_presets.py +5 -5
- keras_hub/src/models/pali_gemma/pali_gemma_tokenizer.py +11 -3
- keras_hub/src/models/phi3/__init__.py +1 -2
- keras_hub/src/models/phi3/phi3_causal_lm.py +3 -9
- keras_hub/src/models/phi3/phi3_causal_lm_preprocessor.py +6 -89
- keras_hub/src/models/phi3/phi3_tokenizer.py +12 -36
- keras_hub/src/models/preprocessor.py +72 -83
- keras_hub/src/models/resnet/__init__.py +6 -0
- keras_hub/src/models/resnet/resnet_backbone.py +390 -42
- keras_hub/src/models/resnet/resnet_image_classifier.py +33 -6
- keras_hub/src/models/resnet/resnet_image_classifier_preprocessor.py +28 -0
- keras_hub/src/models/{llama3/llama3_preprocessor.py → resnet/resnet_image_converter.py} +7 -5
- keras_hub/src/models/resnet/resnet_presets.py +95 -0
- keras_hub/src/models/retinanet/__init__.py +13 -0
- keras_hub/src/models/retinanet/anchor_generator.py +175 -0
- keras_hub/src/models/retinanet/box_matcher.py +259 -0
- keras_hub/src/models/retinanet/non_max_supression.py +578 -0
- keras_hub/src/models/roberta/__init__.py +1 -2
- keras_hub/src/models/roberta/roberta_masked_lm_preprocessor.py +22 -74
- keras_hub/src/models/roberta/{roberta_classifier.py → roberta_text_classifier.py} +16 -11
- keras_hub/src/models/roberta/{roberta_preprocessor.py → roberta_text_classifier_preprocessor.py} +21 -53
- keras_hub/src/models/roberta/roberta_tokenizer.py +13 -52
- keras_hub/src/models/seq_2_seq_lm_preprocessor.py +269 -0
- keras_hub/src/models/stable_diffusion_v3/__init__.py +13 -0
- keras_hub/src/models/stable_diffusion_v3/clip_encoder_block.py +103 -0
- keras_hub/src/models/stable_diffusion_v3/clip_preprocessor.py +93 -0
- keras_hub/src/models/stable_diffusion_v3/clip_text_encoder.py +149 -0
- keras_hub/src/models/stable_diffusion_v3/clip_tokenizer.py +167 -0
- keras_hub/src/models/stable_diffusion_v3/mmdit.py +427 -0
- keras_hub/src/models/stable_diffusion_v3/mmdit_block.py +317 -0
- keras_hub/src/models/stable_diffusion_v3/t5_xxl_preprocessor.py +74 -0
- keras_hub/src/models/stable_diffusion_v3/t5_xxl_text_encoder.py +155 -0
- keras_hub/src/models/stable_diffusion_v3/vae_attention.py +126 -0
- keras_hub/src/models/stable_diffusion_v3/vae_image_decoder.py +186 -0
- keras_hub/src/models/t5/__init__.py +1 -2
- keras_hub/src/models/t5/t5_tokenizer.py +13 -23
- keras_hub/src/models/task.py +71 -116
- keras_hub/src/models/{classifier.py → text_classifier.py} +19 -13
- keras_hub/src/models/text_classifier_preprocessor.py +138 -0
- keras_hub/src/models/whisper/__init__.py +1 -2
- keras_hub/src/models/whisper/{whisper_audio_feature_extractor.py → whisper_audio_converter.py} +20 -18
- keras_hub/src/models/whisper/whisper_backbone.py +0 -3
- keras_hub/src/models/whisper/whisper_presets.py +10 -10
- keras_hub/src/models/whisper/whisper_tokenizer.py +20 -16
- keras_hub/src/models/xlm_roberta/__init__.py +1 -4
- keras_hub/src/models/xlm_roberta/xlm_roberta_masked_lm_preprocessor.py +26 -72
- keras_hub/src/models/xlm_roberta/{xlm_roberta_classifier.py → xlm_roberta_text_classifier.py} +16 -11
- keras_hub/src/models/xlm_roberta/{xlm_roberta_preprocessor.py → xlm_roberta_text_classifier_preprocessor.py} +26 -53
- keras_hub/src/models/xlm_roberta/xlm_roberta_tokenizer.py +25 -10
- keras_hub/src/tests/test_case.py +46 -0
- keras_hub/src/tokenizers/byte_pair_tokenizer.py +30 -17
- keras_hub/src/tokenizers/byte_tokenizer.py +14 -15
- keras_hub/src/tokenizers/sentence_piece_tokenizer.py +20 -7
- keras_hub/src/tokenizers/tokenizer.py +67 -32
- keras_hub/src/tokenizers/unicode_codepoint_tokenizer.py +14 -15
- keras_hub/src/tokenizers/word_piece_tokenizer.py +34 -47
- keras_hub/src/utils/imagenet/__init__.py +13 -0
- keras_hub/src/utils/imagenet/imagenet_utils.py +1067 -0
- keras_hub/src/utils/keras_utils.py +0 -50
- keras_hub/src/utils/preset_utils.py +230 -68
- keras_hub/src/utils/tensor_utils.py +187 -69
- keras_hub/src/utils/timm/convert_resnet.py +19 -16
- keras_hub/src/utils/timm/preset_loader.py +66 -0
- keras_hub/src/utils/transformers/convert_albert.py +193 -0
- keras_hub/src/utils/transformers/convert_bart.py +373 -0
- keras_hub/src/utils/transformers/convert_bert.py +7 -17
- keras_hub/src/utils/transformers/convert_distilbert.py +10 -20
- keras_hub/src/utils/transformers/convert_gemma.py +5 -19
- keras_hub/src/utils/transformers/convert_gpt2.py +5 -18
- keras_hub/src/utils/transformers/convert_llama3.py +7 -18
- keras_hub/src/utils/transformers/convert_mistral.py +129 -0
- keras_hub/src/utils/transformers/convert_pali_gemma.py +7 -29
- keras_hub/src/utils/transformers/preset_loader.py +77 -0
- keras_hub/src/utils/transformers/safetensor_utils.py +2 -2
- keras_hub/src/version_utils.py +1 -1
- keras_hub_nightly-0.16.0.dev2024092017.dist-info/METADATA +202 -0
- keras_hub_nightly-0.16.0.dev2024092017.dist-info/RECORD +334 -0
- {keras_hub_nightly-0.15.0.dev20240823171555.dist-info → keras_hub_nightly-0.16.0.dev2024092017.dist-info}/WHEEL +1 -1
- keras_hub/src/models/bart/bart_preprocessor.py +0 -276
- keras_hub/src/models/bloom/bloom_preprocessor.py +0 -185
- keras_hub/src/models/electra/electra_preprocessor.py +0 -154
- keras_hub/src/models/falcon/falcon_preprocessor.py +0 -187
- keras_hub/src/models/gemma/gemma_preprocessor.py +0 -191
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_preprocessor.py +0 -145
- keras_hub/src/models/llama/llama_preprocessor.py +0 -189
- keras_hub/src/models/mistral/mistral_preprocessor.py +0 -190
- keras_hub/src/models/opt/opt_preprocessor.py +0 -188
- keras_hub/src/models/phi3/phi3_preprocessor.py +0 -190
- keras_hub/src/models/whisper/whisper_preprocessor.py +0 -326
- keras_hub/src/utils/timm/convert.py +0 -37
- keras_hub/src/utils/transformers/convert.py +0 -101
- keras_hub_nightly-0.15.0.dev20240823171555.dist-info/METADATA +0 -34
- keras_hub_nightly-0.15.0.dev20240823171555.dist-info/RECORD +0 -297
- {keras_hub_nightly-0.15.0.dev20240823171555.dist-info → keras_hub_nightly-0.16.0.dev2024092017.dist-info}/top_level.txt +0 -0
keras_hub/__init__.py
CHANGED
@@ -11,12 +11,6 @@
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
|
-
"""DO NOT EDIT.
|
15
|
-
|
16
|
-
This file was autogenerated. Do not edit it by hand,
|
17
|
-
since your modifications would be overwritten.
|
18
|
-
"""
|
19
|
-
|
20
14
|
import os
|
21
15
|
|
22
16
|
# sentencepiece segfaults on some version of tensorflow if tf is imported first.
|
keras_hub/api/__init__.py
CHANGED
@@ -17,11 +17,13 @@ This file was autogenerated. Do not edit it by hand,
|
|
17
17
|
since your modifications would be overwritten.
|
18
18
|
"""
|
19
19
|
|
20
|
+
from keras_hub.api import bounding_box
|
20
21
|
from keras_hub.api import layers
|
21
22
|
from keras_hub.api import metrics
|
22
23
|
from keras_hub.api import models
|
23
24
|
from keras_hub.api import samplers
|
24
25
|
from keras_hub.api import tokenizers
|
26
|
+
from keras_hub.api import utils
|
25
27
|
from keras_hub.src.utils.preset_utils import upload_preset
|
26
28
|
from keras_hub.src.version_utils import __version__
|
27
29
|
from keras_hub.src.version_utils import version
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright 2024 The KerasHub Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
"""DO NOT EDIT.
|
15
|
+
|
16
|
+
This file was autogenerated. Do not edit it by hand,
|
17
|
+
since your modifications would be overwritten.
|
18
|
+
"""
|
19
|
+
|
20
|
+
from keras_hub.src.bounding_box.converters import convert_format
|
21
|
+
from keras_hub.src.bounding_box.formats import CENTER_XYWH
|
22
|
+
from keras_hub.src.bounding_box.formats import REL_XYWH
|
23
|
+
from keras_hub.src.bounding_box.formats import REL_XYXY
|
24
|
+
from keras_hub.src.bounding_box.formats import REL_YXYX
|
25
|
+
from keras_hub.src.bounding_box.formats import XYWH
|
26
|
+
from keras_hub.src.bounding_box.formats import XYXY
|
27
|
+
from keras_hub.src.bounding_box.formats import YXYX
|
28
|
+
from keras_hub.src.bounding_box.iou import compute_ciou
|
29
|
+
from keras_hub.src.bounding_box.iou import compute_iou
|
30
|
+
from keras_hub.src.bounding_box.to_dense import to_dense
|
31
|
+
from keras_hub.src.bounding_box.to_ragged import to_ragged
|
32
|
+
from keras_hub.src.bounding_box.utils import as_relative
|
33
|
+
from keras_hub.src.bounding_box.utils import clip_boxes
|
34
|
+
from keras_hub.src.bounding_box.utils import clip_to_image
|
35
|
+
from keras_hub.src.bounding_box.utils import is_relative
|
36
|
+
from keras_hub.src.bounding_box.validate_format import validate_format
|
keras_hub/api/layers/__init__.py
CHANGED
@@ -36,6 +36,8 @@ from keras_hub.src.layers.modeling.token_and_position_embedding import (
|
|
36
36
|
)
|
37
37
|
from keras_hub.src.layers.modeling.transformer_decoder import TransformerDecoder
|
38
38
|
from keras_hub.src.layers.modeling.transformer_encoder import TransformerEncoder
|
39
|
+
from keras_hub.src.layers.preprocessing.audio_converter import AudioConverter
|
40
|
+
from keras_hub.src.layers.preprocessing.image_converter import ImageConverter
|
39
41
|
from keras_hub.src.layers.preprocessing.masked_lm_mask_generator import (
|
40
42
|
MaskedLMMaskGenerator,
|
41
43
|
)
|
@@ -44,4 +46,16 @@ from keras_hub.src.layers.preprocessing.multi_segment_packer import (
|
|
44
46
|
)
|
45
47
|
from keras_hub.src.layers.preprocessing.random_deletion import RandomDeletion
|
46
48
|
from keras_hub.src.layers.preprocessing.random_swap import RandomSwap
|
49
|
+
from keras_hub.src.layers.preprocessing.resizing_image_converter import (
|
50
|
+
ResizingImageConverter,
|
51
|
+
)
|
47
52
|
from keras_hub.src.layers.preprocessing.start_end_packer import StartEndPacker
|
53
|
+
from keras_hub.src.models.pali_gemma.pali_gemma_image_converter import (
|
54
|
+
PaliGemmaImageConverter,
|
55
|
+
)
|
56
|
+
from keras_hub.src.models.resnet.resnet_image_converter import (
|
57
|
+
ResNetImageConverter,
|
58
|
+
)
|
59
|
+
from keras_hub.src.models.whisper.whisper_audio_converter import (
|
60
|
+
WhisperAudioConverter,
|
61
|
+
)
|
keras_hub/api/models/__init__.py
CHANGED
@@ -18,38 +18,54 @@ since your modifications would be overwritten.
|
|
18
18
|
"""
|
19
19
|
|
20
20
|
from keras_hub.src.models.albert.albert_backbone import AlbertBackbone
|
21
|
-
from keras_hub.src.models.albert.albert_classifier import AlbertClassifier
|
22
21
|
from keras_hub.src.models.albert.albert_masked_lm import AlbertMaskedLM
|
23
22
|
from keras_hub.src.models.albert.albert_masked_lm_preprocessor import (
|
24
23
|
AlbertMaskedLMPreprocessor,
|
25
24
|
)
|
26
|
-
from keras_hub.src.models.albert.
|
25
|
+
from keras_hub.src.models.albert.albert_text_classifier import (
|
26
|
+
AlbertTextClassifier,
|
27
|
+
)
|
28
|
+
from keras_hub.src.models.albert.albert_text_classifier import (
|
29
|
+
AlbertTextClassifier as AlbertClassifier,
|
30
|
+
)
|
31
|
+
from keras_hub.src.models.albert.albert_text_classifier_preprocessor import (
|
32
|
+
AlbertTextClassifierPreprocessor,
|
33
|
+
)
|
34
|
+
from keras_hub.src.models.albert.albert_text_classifier_preprocessor import (
|
35
|
+
AlbertTextClassifierPreprocessor as AlbertPreprocessor,
|
36
|
+
)
|
27
37
|
from keras_hub.src.models.albert.albert_tokenizer import AlbertTokenizer
|
28
38
|
from keras_hub.src.models.backbone import Backbone
|
29
39
|
from keras_hub.src.models.bart.bart_backbone import BartBackbone
|
30
|
-
from keras_hub.src.models.bart.bart_preprocessor import BartPreprocessor
|
31
40
|
from keras_hub.src.models.bart.bart_seq_2_seq_lm import BartSeq2SeqLM
|
32
41
|
from keras_hub.src.models.bart.bart_seq_2_seq_lm_preprocessor import (
|
33
42
|
BartSeq2SeqLMPreprocessor,
|
34
43
|
)
|
35
44
|
from keras_hub.src.models.bart.bart_tokenizer import BartTokenizer
|
36
45
|
from keras_hub.src.models.bert.bert_backbone import BertBackbone
|
37
|
-
from keras_hub.src.models.bert.bert_classifier import BertClassifier
|
38
46
|
from keras_hub.src.models.bert.bert_masked_lm import BertMaskedLM
|
39
47
|
from keras_hub.src.models.bert.bert_masked_lm_preprocessor import (
|
40
48
|
BertMaskedLMPreprocessor,
|
41
49
|
)
|
42
|
-
from keras_hub.src.models.bert.
|
50
|
+
from keras_hub.src.models.bert.bert_text_classifier import BertTextClassifier
|
51
|
+
from keras_hub.src.models.bert.bert_text_classifier import (
|
52
|
+
BertTextClassifier as BertClassifier,
|
53
|
+
)
|
54
|
+
from keras_hub.src.models.bert.bert_text_classifier_preprocessor import (
|
55
|
+
BertTextClassifierPreprocessor,
|
56
|
+
)
|
57
|
+
from keras_hub.src.models.bert.bert_text_classifier_preprocessor import (
|
58
|
+
BertTextClassifierPreprocessor as BertPreprocessor,
|
59
|
+
)
|
43
60
|
from keras_hub.src.models.bert.bert_tokenizer import BertTokenizer
|
44
61
|
from keras_hub.src.models.bloom.bloom_backbone import BloomBackbone
|
45
62
|
from keras_hub.src.models.bloom.bloom_causal_lm import BloomCausalLM
|
46
63
|
from keras_hub.src.models.bloom.bloom_causal_lm_preprocessor import (
|
47
64
|
BloomCausalLMPreprocessor,
|
48
65
|
)
|
49
|
-
from keras_hub.src.models.bloom.bloom_preprocessor import BloomPreprocessor
|
50
66
|
from keras_hub.src.models.bloom.bloom_tokenizer import BloomTokenizer
|
51
67
|
from keras_hub.src.models.causal_lm import CausalLM
|
52
|
-
from keras_hub.src.models.
|
68
|
+
from keras_hub.src.models.causal_lm_preprocessor import CausalLMPreprocessor
|
53
69
|
from keras_hub.src.models.csp_darknet.csp_darknet_backbone import (
|
54
70
|
CSPDarkNetBackbone,
|
55
71
|
)
|
@@ -59,17 +75,23 @@ from keras_hub.src.models.csp_darknet.csp_darknet_image_classifier import (
|
|
59
75
|
from keras_hub.src.models.deberta_v3.deberta_v3_backbone import (
|
60
76
|
DebertaV3Backbone,
|
61
77
|
)
|
62
|
-
from keras_hub.src.models.deberta_v3.deberta_v3_classifier import (
|
63
|
-
DebertaV3Classifier,
|
64
|
-
)
|
65
78
|
from keras_hub.src.models.deberta_v3.deberta_v3_masked_lm import (
|
66
79
|
DebertaV3MaskedLM,
|
67
80
|
)
|
68
81
|
from keras_hub.src.models.deberta_v3.deberta_v3_masked_lm_preprocessor import (
|
69
82
|
DebertaV3MaskedLMPreprocessor,
|
70
83
|
)
|
71
|
-
from keras_hub.src.models.deberta_v3.
|
72
|
-
|
84
|
+
from keras_hub.src.models.deberta_v3.deberta_v3_text_classifier import (
|
85
|
+
DebertaV3TextClassifier,
|
86
|
+
)
|
87
|
+
from keras_hub.src.models.deberta_v3.deberta_v3_text_classifier import (
|
88
|
+
DebertaV3TextClassifier as DebertaV3Classifier,
|
89
|
+
)
|
90
|
+
from keras_hub.src.models.deberta_v3.deberta_v3_text_classifier_preprocessor import (
|
91
|
+
DebertaV3TextClassifierPreprocessor,
|
92
|
+
)
|
93
|
+
from keras_hub.src.models.deberta_v3.deberta_v3_text_classifier_preprocessor import (
|
94
|
+
DebertaV3TextClassifierPreprocessor as DebertaV3Preprocessor,
|
73
95
|
)
|
74
96
|
from keras_hub.src.models.deberta_v3.deberta_v3_tokenizer import (
|
75
97
|
DebertaV3Tokenizer,
|
@@ -81,40 +103,53 @@ from keras_hub.src.models.densenet.densenet_image_classifier import (
|
|
81
103
|
from keras_hub.src.models.distil_bert.distil_bert_backbone import (
|
82
104
|
DistilBertBackbone,
|
83
105
|
)
|
84
|
-
from keras_hub.src.models.distil_bert.distil_bert_classifier import (
|
85
|
-
DistilBertClassifier,
|
86
|
-
)
|
87
106
|
from keras_hub.src.models.distil_bert.distil_bert_masked_lm import (
|
88
107
|
DistilBertMaskedLM,
|
89
108
|
)
|
90
109
|
from keras_hub.src.models.distil_bert.distil_bert_masked_lm_preprocessor import (
|
91
110
|
DistilBertMaskedLMPreprocessor,
|
92
111
|
)
|
93
|
-
from keras_hub.src.models.distil_bert.
|
94
|
-
|
112
|
+
from keras_hub.src.models.distil_bert.distil_bert_text_classifier import (
|
113
|
+
DistilBertTextClassifier,
|
114
|
+
)
|
115
|
+
from keras_hub.src.models.distil_bert.distil_bert_text_classifier import (
|
116
|
+
DistilBertTextClassifier as DistilBertClassifier,
|
117
|
+
)
|
118
|
+
from keras_hub.src.models.distil_bert.distil_bert_text_classifier_preprocessor import (
|
119
|
+
DistilBertTextClassifierPreprocessor,
|
120
|
+
)
|
121
|
+
from keras_hub.src.models.distil_bert.distil_bert_text_classifier_preprocessor import (
|
122
|
+
DistilBertTextClassifierPreprocessor as DistilBertPreprocessor,
|
95
123
|
)
|
96
124
|
from keras_hub.src.models.distil_bert.distil_bert_tokenizer import (
|
97
125
|
DistilBertTokenizer,
|
98
126
|
)
|
99
|
-
from keras_hub.src.models.
|
100
|
-
|
101
|
-
ElectraPreprocessor,
|
127
|
+
from keras_hub.src.models.efficientnet.efficientnet_backbone import (
|
128
|
+
EfficientNetBackbone,
|
102
129
|
)
|
130
|
+
from keras_hub.src.models.electra.electra_backbone import ElectraBackbone
|
103
131
|
from keras_hub.src.models.electra.electra_tokenizer import ElectraTokenizer
|
104
132
|
from keras_hub.src.models.f_net.f_net_backbone import FNetBackbone
|
105
|
-
from keras_hub.src.models.f_net.f_net_classifier import FNetClassifier
|
106
133
|
from keras_hub.src.models.f_net.f_net_masked_lm import FNetMaskedLM
|
107
134
|
from keras_hub.src.models.f_net.f_net_masked_lm_preprocessor import (
|
108
135
|
FNetMaskedLMPreprocessor,
|
109
136
|
)
|
110
|
-
from keras_hub.src.models.f_net.
|
137
|
+
from keras_hub.src.models.f_net.f_net_text_classifier import FNetTextClassifier
|
138
|
+
from keras_hub.src.models.f_net.f_net_text_classifier import (
|
139
|
+
FNetTextClassifier as FNetClassifier,
|
140
|
+
)
|
141
|
+
from keras_hub.src.models.f_net.f_net_text_classifier_preprocessor import (
|
142
|
+
FNetTextClassifierPreprocessor,
|
143
|
+
)
|
144
|
+
from keras_hub.src.models.f_net.f_net_text_classifier_preprocessor import (
|
145
|
+
FNetTextClassifierPreprocessor as FNetPreprocessor,
|
146
|
+
)
|
111
147
|
from keras_hub.src.models.f_net.f_net_tokenizer import FNetTokenizer
|
112
148
|
from keras_hub.src.models.falcon.falcon_backbone import FalconBackbone
|
113
149
|
from keras_hub.src.models.falcon.falcon_causal_lm import FalconCausalLM
|
114
150
|
from keras_hub.src.models.falcon.falcon_causal_lm_preprocessor import (
|
115
151
|
FalconCausalLMPreprocessor,
|
116
152
|
)
|
117
|
-
from keras_hub.src.models.falcon.falcon_preprocessor import FalconPreprocessor
|
118
153
|
from keras_hub.src.models.falcon.falcon_tokenizer import FalconTokenizer
|
119
154
|
from keras_hub.src.models.feature_pyramid_backbone import FeaturePyramidBackbone
|
120
155
|
from keras_hub.src.models.gemma.gemma_backbone import GemmaBackbone
|
@@ -122,7 +157,6 @@ from keras_hub.src.models.gemma.gemma_causal_lm import GemmaCausalLM
|
|
122
157
|
from keras_hub.src.models.gemma.gemma_causal_lm_preprocessor import (
|
123
158
|
GemmaCausalLMPreprocessor,
|
124
159
|
)
|
125
|
-
from keras_hub.src.models.gemma.gemma_preprocessor import GemmaPreprocessor
|
126
160
|
from keras_hub.src.models.gemma.gemma_tokenizer import GemmaTokenizer
|
127
161
|
from keras_hub.src.models.gpt2.gpt2_backbone import GPT2Backbone
|
128
162
|
from keras_hub.src.models.gpt2.gpt2_causal_lm import GPT2CausalLM
|
@@ -136,34 +170,30 @@ from keras_hub.src.models.gpt_neo_x.gpt_neo_x_causal_lm import GPTNeoXCausalLM
|
|
136
170
|
from keras_hub.src.models.gpt_neo_x.gpt_neo_x_causal_lm_preprocessor import (
|
137
171
|
GPTNeoXCausalLMPreprocessor,
|
138
172
|
)
|
139
|
-
from keras_hub.src.models.gpt_neo_x.gpt_neo_x_preprocessor import (
|
140
|
-
GPTNeoXPreprocessor,
|
141
|
-
)
|
142
173
|
from keras_hub.src.models.gpt_neo_x.gpt_neo_x_tokenizer import GPTNeoXTokenizer
|
143
174
|
from keras_hub.src.models.image_classifier import ImageClassifier
|
175
|
+
from keras_hub.src.models.image_classifier_preprocessor import (
|
176
|
+
ImageClassifierPreprocessor,
|
177
|
+
)
|
144
178
|
from keras_hub.src.models.llama3.llama3_backbone import Llama3Backbone
|
145
179
|
from keras_hub.src.models.llama3.llama3_causal_lm import Llama3CausalLM
|
146
180
|
from keras_hub.src.models.llama3.llama3_causal_lm_preprocessor import (
|
147
181
|
Llama3CausalLMPreprocessor,
|
148
182
|
)
|
149
|
-
from keras_hub.src.models.llama3.llama3_preprocessor import Llama3Preprocessor
|
150
183
|
from keras_hub.src.models.llama3.llama3_tokenizer import Llama3Tokenizer
|
151
184
|
from keras_hub.src.models.llama.llama_backbone import LlamaBackbone
|
152
185
|
from keras_hub.src.models.llama.llama_causal_lm import LlamaCausalLM
|
153
186
|
from keras_hub.src.models.llama.llama_causal_lm_preprocessor import (
|
154
187
|
LlamaCausalLMPreprocessor,
|
155
188
|
)
|
156
|
-
from keras_hub.src.models.llama.llama_preprocessor import LlamaPreprocessor
|
157
189
|
from keras_hub.src.models.llama.llama_tokenizer import LlamaTokenizer
|
158
190
|
from keras_hub.src.models.masked_lm import MaskedLM
|
191
|
+
from keras_hub.src.models.masked_lm_preprocessor import MaskedLMPreprocessor
|
159
192
|
from keras_hub.src.models.mistral.mistral_backbone import MistralBackbone
|
160
193
|
from keras_hub.src.models.mistral.mistral_causal_lm import MistralCausalLM
|
161
194
|
from keras_hub.src.models.mistral.mistral_causal_lm_preprocessor import (
|
162
195
|
MistralCausalLMPreprocessor,
|
163
196
|
)
|
164
|
-
from keras_hub.src.models.mistral.mistral_preprocessor import (
|
165
|
-
MistralPreprocessor,
|
166
|
-
)
|
167
197
|
from keras_hub.src.models.mistral.mistral_tokenizer import MistralTokenizer
|
168
198
|
from keras_hub.src.models.mix_transformer.mix_transformer_backbone import (
|
169
199
|
MiTBackbone,
|
@@ -171,12 +201,15 @@ from keras_hub.src.models.mix_transformer.mix_transformer_backbone import (
|
|
171
201
|
from keras_hub.src.models.mix_transformer.mix_transformer_classifier import (
|
172
202
|
MiTImageClassifier,
|
173
203
|
)
|
204
|
+
from keras_hub.src.models.mobilenet.mobilenet_backbone import MobileNetBackbone
|
205
|
+
from keras_hub.src.models.mobilenet.mobilenet_image_classifier import (
|
206
|
+
MobileNetImageClassifier,
|
207
|
+
)
|
174
208
|
from keras_hub.src.models.opt.opt_backbone import OPTBackbone
|
175
209
|
from keras_hub.src.models.opt.opt_causal_lm import OPTCausalLM
|
176
210
|
from keras_hub.src.models.opt.opt_causal_lm_preprocessor import (
|
177
211
|
OPTCausalLMPreprocessor,
|
178
212
|
)
|
179
|
-
from keras_hub.src.models.opt.opt_preprocessor import OPTPreprocessor
|
180
213
|
from keras_hub.src.models.opt.opt_tokenizer import OPTTokenizer
|
181
214
|
from keras_hub.src.models.pali_gemma.pali_gemma_backbone import (
|
182
215
|
PaliGemmaBackbone,
|
@@ -195,52 +228,68 @@ from keras_hub.src.models.phi3.phi3_causal_lm import Phi3CausalLM
|
|
195
228
|
from keras_hub.src.models.phi3.phi3_causal_lm_preprocessor import (
|
196
229
|
Phi3CausalLMPreprocessor,
|
197
230
|
)
|
198
|
-
from keras_hub.src.models.phi3.phi3_preprocessor import Phi3Preprocessor
|
199
231
|
from keras_hub.src.models.phi3.phi3_tokenizer import Phi3Tokenizer
|
200
232
|
from keras_hub.src.models.preprocessor import Preprocessor
|
201
233
|
from keras_hub.src.models.resnet.resnet_backbone import ResNetBackbone
|
202
234
|
from keras_hub.src.models.resnet.resnet_image_classifier import (
|
203
235
|
ResNetImageClassifier,
|
204
236
|
)
|
237
|
+
from keras_hub.src.models.resnet.resnet_image_classifier_preprocessor import (
|
238
|
+
ResNetImageClassifierPreprocessor,
|
239
|
+
)
|
205
240
|
from keras_hub.src.models.roberta.roberta_backbone import RobertaBackbone
|
206
|
-
from keras_hub.src.models.roberta.roberta_classifier import RobertaClassifier
|
207
241
|
from keras_hub.src.models.roberta.roberta_masked_lm import RobertaMaskedLM
|
208
242
|
from keras_hub.src.models.roberta.roberta_masked_lm_preprocessor import (
|
209
243
|
RobertaMaskedLMPreprocessor,
|
210
244
|
)
|
211
|
-
from keras_hub.src.models.roberta.
|
212
|
-
|
245
|
+
from keras_hub.src.models.roberta.roberta_text_classifier import (
|
246
|
+
RobertaTextClassifier,
|
247
|
+
)
|
248
|
+
from keras_hub.src.models.roberta.roberta_text_classifier import (
|
249
|
+
RobertaTextClassifier as RobertaClassifier,
|
250
|
+
)
|
251
|
+
from keras_hub.src.models.roberta.roberta_text_classifier_preprocessor import (
|
252
|
+
RobertaTextClassifierPreprocessor,
|
253
|
+
)
|
254
|
+
from keras_hub.src.models.roberta.roberta_text_classifier_preprocessor import (
|
255
|
+
RobertaTextClassifierPreprocessor as RobertaPreprocessor,
|
213
256
|
)
|
214
257
|
from keras_hub.src.models.roberta.roberta_tokenizer import RobertaTokenizer
|
215
258
|
from keras_hub.src.models.seq_2_seq_lm import Seq2SeqLM
|
259
|
+
from keras_hub.src.models.seq_2_seq_lm_preprocessor import Seq2SeqLMPreprocessor
|
216
260
|
from keras_hub.src.models.t5.t5_backbone import T5Backbone
|
217
261
|
from keras_hub.src.models.t5.t5_tokenizer import T5Tokenizer
|
218
262
|
from keras_hub.src.models.task import Task
|
263
|
+
from keras_hub.src.models.text_classifier import TextClassifier
|
264
|
+
from keras_hub.src.models.text_classifier import TextClassifier as Classifier
|
265
|
+
from keras_hub.src.models.text_classifier_preprocessor import (
|
266
|
+
TextClassifierPreprocessor,
|
267
|
+
)
|
219
268
|
from keras_hub.src.models.vgg.vgg_backbone import VGGBackbone
|
220
269
|
from keras_hub.src.models.vgg.vgg_image_classifier import VGGImageClassifier
|
221
270
|
from keras_hub.src.models.vit_det.vit_det_backbone import ViTDetBackbone
|
222
|
-
from keras_hub.src.models.whisper.whisper_audio_feature_extractor import (
|
223
|
-
WhisperAudioFeatureExtractor,
|
224
|
-
)
|
225
271
|
from keras_hub.src.models.whisper.whisper_backbone import WhisperBackbone
|
226
|
-
from keras_hub.src.models.whisper.whisper_preprocessor import (
|
227
|
-
WhisperPreprocessor,
|
228
|
-
)
|
229
272
|
from keras_hub.src.models.whisper.whisper_tokenizer import WhisperTokenizer
|
230
273
|
from keras_hub.src.models.xlm_roberta.xlm_roberta_backbone import (
|
231
274
|
XLMRobertaBackbone,
|
232
275
|
)
|
233
|
-
from keras_hub.src.models.xlm_roberta.xlm_roberta_classifier import (
|
234
|
-
XLMRobertaClassifier,
|
235
|
-
)
|
236
276
|
from keras_hub.src.models.xlm_roberta.xlm_roberta_masked_lm import (
|
237
277
|
XLMRobertaMaskedLM,
|
238
278
|
)
|
239
279
|
from keras_hub.src.models.xlm_roberta.xlm_roberta_masked_lm_preprocessor import (
|
240
280
|
XLMRobertaMaskedLMPreprocessor,
|
241
281
|
)
|
242
|
-
from keras_hub.src.models.xlm_roberta.
|
243
|
-
|
282
|
+
from keras_hub.src.models.xlm_roberta.xlm_roberta_text_classifier import (
|
283
|
+
XLMRobertaTextClassifier,
|
284
|
+
)
|
285
|
+
from keras_hub.src.models.xlm_roberta.xlm_roberta_text_classifier import (
|
286
|
+
XLMRobertaTextClassifier as XLMRobertaClassifier,
|
287
|
+
)
|
288
|
+
from keras_hub.src.models.xlm_roberta.xlm_roberta_text_classifier_preprocessor import (
|
289
|
+
XLMRobertaTextClassifierPreprocessor,
|
290
|
+
)
|
291
|
+
from keras_hub.src.models.xlm_roberta.xlm_roberta_text_classifier_preprocessor import (
|
292
|
+
XLMRobertaTextClassifierPreprocessor as XLMRobertaPreprocessor,
|
244
293
|
)
|
245
294
|
from keras_hub.src.models.xlm_roberta.xlm_roberta_tokenizer import (
|
246
295
|
XLMRobertaTokenizer,
|
@@ -17,6 +17,36 @@ This file was autogenerated. Do not edit it by hand,
|
|
17
17
|
since your modifications would be overwritten.
|
18
18
|
"""
|
19
19
|
|
20
|
+
from keras_hub.src.models.albert.albert_tokenizer import AlbertTokenizer
|
21
|
+
from keras_hub.src.models.bart.bart_tokenizer import BartTokenizer
|
22
|
+
from keras_hub.src.models.bert.bert_tokenizer import BertTokenizer
|
23
|
+
from keras_hub.src.models.bloom.bloom_tokenizer import BloomTokenizer
|
24
|
+
from keras_hub.src.models.deberta_v3.deberta_v3_tokenizer import (
|
25
|
+
DebertaV3Tokenizer,
|
26
|
+
)
|
27
|
+
from keras_hub.src.models.distil_bert.distil_bert_tokenizer import (
|
28
|
+
DistilBertTokenizer,
|
29
|
+
)
|
30
|
+
from keras_hub.src.models.electra.electra_tokenizer import ElectraTokenizer
|
31
|
+
from keras_hub.src.models.f_net.f_net_tokenizer import FNetTokenizer
|
32
|
+
from keras_hub.src.models.falcon.falcon_tokenizer import FalconTokenizer
|
33
|
+
from keras_hub.src.models.gemma.gemma_tokenizer import GemmaTokenizer
|
34
|
+
from keras_hub.src.models.gpt2.gpt2_tokenizer import GPT2Tokenizer
|
35
|
+
from keras_hub.src.models.gpt_neo_x.gpt_neo_x_tokenizer import GPTNeoXTokenizer
|
36
|
+
from keras_hub.src.models.llama3.llama3_tokenizer import Llama3Tokenizer
|
37
|
+
from keras_hub.src.models.llama.llama_tokenizer import LlamaTokenizer
|
38
|
+
from keras_hub.src.models.mistral.mistral_tokenizer import MistralTokenizer
|
39
|
+
from keras_hub.src.models.opt.opt_tokenizer import OPTTokenizer
|
40
|
+
from keras_hub.src.models.pali_gemma.pali_gemma_tokenizer import (
|
41
|
+
PaliGemmaTokenizer,
|
42
|
+
)
|
43
|
+
from keras_hub.src.models.phi3.phi3_tokenizer import Phi3Tokenizer
|
44
|
+
from keras_hub.src.models.roberta.roberta_tokenizer import RobertaTokenizer
|
45
|
+
from keras_hub.src.models.t5.t5_tokenizer import T5Tokenizer
|
46
|
+
from keras_hub.src.models.whisper.whisper_tokenizer import WhisperTokenizer
|
47
|
+
from keras_hub.src.models.xlm_roberta.xlm_roberta_tokenizer import (
|
48
|
+
XLMRobertaTokenizer,
|
49
|
+
)
|
20
50
|
from keras_hub.src.tokenizers.byte_pair_tokenizer import BytePairTokenizer
|
21
51
|
from keras_hub.src.tokenizers.byte_tokenizer import ByteTokenizer
|
22
52
|
from keras_hub.src.tokenizers.sentence_piece_tokenizer import (
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright 2024 The KerasHub Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
"""DO NOT EDIT.
|
15
|
+
|
16
|
+
This file was autogenerated. Do not edit it by hand,
|
17
|
+
since your modifications would be overwritten.
|
18
|
+
"""
|
19
|
+
|
20
|
+
from keras_hub.src.utils.imagenet.imagenet_utils import (
|
21
|
+
decode_imagenet_predictions,
|
22
|
+
)
|
keras_hub/src/api_export.py
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
import types
|
16
16
|
|
17
|
-
import
|
17
|
+
from keras.saving import register_keras_serializable
|
18
18
|
|
19
19
|
try:
|
20
20
|
import namex
|
@@ -22,14 +22,20 @@ except ImportError:
|
|
22
22
|
namex = None
|
23
23
|
|
24
24
|
|
25
|
-
def maybe_register_serializable(symbol):
|
25
|
+
def maybe_register_serializable(path, symbol):
|
26
|
+
if isinstance(path, (list, tuple)):
|
27
|
+
# If we have multiple export names, actually make sure to register these
|
28
|
+
# first. This makes sure we have a backward compat mapping of old
|
29
|
+
# serialized names to new class.
|
30
|
+
for name in path:
|
31
|
+
name = name.split(".")[-1]
|
32
|
+
register_keras_serializable(package="keras_nlp", name=name)(symbol)
|
33
|
+
register_keras_serializable(package="keras_hub", name=name)(symbol)
|
26
34
|
if isinstance(symbol, types.FunctionType) or hasattr(symbol, "get_config"):
|
27
|
-
# We register twice, first with
|
28
|
-
# so loading still works
|
29
|
-
|
30
|
-
|
31
|
-
keras.saving.register_keras_serializable(package=compat_name)(symbol)
|
32
|
-
keras.saving.register_keras_serializable(package="keras_hub")(symbol)
|
35
|
+
# We register twice, first with keras_nlp, second with keras_hub,
|
36
|
+
# so loading still works for classes saved as "keras_nlp".
|
37
|
+
register_keras_serializable(package="keras_nlp")(symbol)
|
38
|
+
register_keras_serializable(package="keras_hub")(symbol)
|
33
39
|
|
34
40
|
|
35
41
|
if namex:
|
@@ -39,7 +45,7 @@ if namex:
|
|
39
45
|
super().__init__(package="keras_hub", path=path)
|
40
46
|
|
41
47
|
def __call__(self, symbol):
|
42
|
-
maybe_register_serializable(symbol)
|
48
|
+
maybe_register_serializable(self.path, symbol)
|
43
49
|
return super().__call__(symbol)
|
44
50
|
|
45
51
|
else:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Copyright 2024 The KerasHub Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|