keras-hub-nightly 0.16.1.dev202409260340__py3-none-any.whl → 0.16.1.dev202409280337__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 -13
- keras_hub/api/__init__.py +0 -13
- keras_hub/api/bounding_box/__init__.py +0 -13
- keras_hub/api/layers/__init__.py +0 -13
- keras_hub/api/metrics/__init__.py +0 -13
- keras_hub/api/models/__init__.py +0 -13
- keras_hub/api/samplers/__init__.py +0 -13
- keras_hub/api/tokenizers/__init__.py +0 -13
- keras_hub/api/utils/__init__.py +0 -13
- keras_hub/src/__init__.py +0 -13
- keras_hub/src/api_export.py +0 -14
- keras_hub/src/bounding_box/__init__.py +0 -13
- keras_hub/src/bounding_box/converters.py +0 -13
- keras_hub/src/bounding_box/formats.py +0 -13
- keras_hub/src/bounding_box/iou.py +1 -13
- keras_hub/src/bounding_box/to_dense.py +0 -14
- keras_hub/src/bounding_box/to_ragged.py +0 -13
- keras_hub/src/bounding_box/utils.py +0 -13
- keras_hub/src/bounding_box/validate_format.py +0 -14
- keras_hub/src/layers/__init__.py +0 -13
- keras_hub/src/layers/modeling/__init__.py +0 -13
- keras_hub/src/layers/modeling/alibi_bias.py +0 -13
- keras_hub/src/layers/modeling/cached_multi_head_attention.py +0 -14
- keras_hub/src/layers/modeling/f_net_encoder.py +0 -14
- keras_hub/src/layers/modeling/masked_lm_head.py +0 -14
- keras_hub/src/layers/modeling/position_embedding.py +0 -14
- keras_hub/src/layers/modeling/reversible_embedding.py +0 -14
- keras_hub/src/layers/modeling/rotary_embedding.py +0 -14
- keras_hub/src/layers/modeling/sine_position_encoding.py +0 -14
- keras_hub/src/layers/modeling/token_and_position_embedding.py +0 -14
- keras_hub/src/layers/modeling/transformer_decoder.py +0 -14
- keras_hub/src/layers/modeling/transformer_encoder.py +0 -14
- keras_hub/src/layers/modeling/transformer_layer_utils.py +0 -14
- keras_hub/src/layers/preprocessing/__init__.py +0 -13
- keras_hub/src/layers/preprocessing/audio_converter.py +0 -13
- keras_hub/src/layers/preprocessing/image_converter.py +0 -13
- keras_hub/src/layers/preprocessing/masked_lm_mask_generator.py +0 -15
- keras_hub/src/layers/preprocessing/multi_segment_packer.py +0 -14
- keras_hub/src/layers/preprocessing/preprocessing_layer.py +0 -14
- keras_hub/src/layers/preprocessing/random_deletion.py +0 -14
- keras_hub/src/layers/preprocessing/random_swap.py +0 -14
- keras_hub/src/layers/preprocessing/resizing_image_converter.py +0 -13
- keras_hub/src/layers/preprocessing/start_end_packer.py +0 -15
- keras_hub/src/metrics/__init__.py +0 -13
- keras_hub/src/metrics/bleu.py +0 -14
- keras_hub/src/metrics/edit_distance.py +0 -14
- keras_hub/src/metrics/perplexity.py +0 -14
- keras_hub/src/metrics/rouge_base.py +0 -14
- keras_hub/src/metrics/rouge_l.py +0 -14
- keras_hub/src/metrics/rouge_n.py +0 -14
- keras_hub/src/models/__init__.py +0 -13
- keras_hub/src/models/albert/__init__.py +0 -14
- keras_hub/src/models/albert/albert_backbone.py +0 -14
- keras_hub/src/models/albert/albert_masked_lm.py +0 -14
- keras_hub/src/models/albert/albert_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/albert/albert_presets.py +0 -14
- keras_hub/src/models/albert/albert_text_classifier.py +0 -14
- keras_hub/src/models/albert/albert_text_classifier_preprocessor.py +0 -14
- keras_hub/src/models/albert/albert_tokenizer.py +0 -14
- keras_hub/src/models/backbone.py +0 -14
- keras_hub/src/models/bart/__init__.py +0 -14
- keras_hub/src/models/bart/bart_backbone.py +0 -14
- keras_hub/src/models/bart/bart_presets.py +0 -13
- keras_hub/src/models/bart/bart_seq_2_seq_lm.py +0 -15
- keras_hub/src/models/bart/bart_seq_2_seq_lm_preprocessor.py +0 -15
- keras_hub/src/models/bart/bart_tokenizer.py +0 -15
- keras_hub/src/models/bert/__init__.py +0 -14
- keras_hub/src/models/bert/bert_backbone.py +0 -14
- keras_hub/src/models/bert/bert_masked_lm.py +0 -14
- keras_hub/src/models/bert/bert_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/bert/bert_presets.py +0 -13
- keras_hub/src/models/bert/bert_text_classifier.py +0 -14
- keras_hub/src/models/bert/bert_text_classifier_preprocessor.py +0 -14
- keras_hub/src/models/bert/bert_tokenizer.py +0 -14
- keras_hub/src/models/bloom/__init__.py +0 -14
- keras_hub/src/models/bloom/bloom_attention.py +0 -13
- keras_hub/src/models/bloom/bloom_backbone.py +0 -14
- keras_hub/src/models/bloom/bloom_causal_lm.py +0 -15
- keras_hub/src/models/bloom/bloom_causal_lm_preprocessor.py +0 -15
- keras_hub/src/models/bloom/bloom_decoder.py +0 -13
- keras_hub/src/models/bloom/bloom_presets.py +0 -13
- keras_hub/src/models/bloom/bloom_tokenizer.py +0 -15
- keras_hub/src/models/causal_lm.py +0 -14
- keras_hub/src/models/causal_lm_preprocessor.py +0 -13
- keras_hub/src/models/clip/__init__.py +0 -13
- keras_hub/src/models/clip/clip_encoder_block.py +0 -13
- keras_hub/src/models/clip/clip_preprocessor.py +1 -14
- keras_hub/src/models/clip/clip_text_encoder.py +0 -13
- keras_hub/src/models/clip/clip_tokenizer.py +4 -19
- keras_hub/src/models/csp_darknet/__init__.py +0 -13
- keras_hub/src/models/csp_darknet/csp_darknet_backbone.py +0 -13
- keras_hub/src/models/csp_darknet/csp_darknet_image_classifier.py +0 -13
- keras_hub/src/models/deberta_v3/__init__.py +0 -14
- keras_hub/src/models/deberta_v3/deberta_v3_backbone.py +0 -15
- keras_hub/src/models/deberta_v3/deberta_v3_masked_lm.py +0 -15
- keras_hub/src/models/deberta_v3/deberta_v3_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/deberta_v3/deberta_v3_presets.py +0 -13
- keras_hub/src/models/deberta_v3/deberta_v3_text_classifier.py +0 -15
- keras_hub/src/models/deberta_v3/deberta_v3_text_classifier_preprocessor.py +0 -14
- keras_hub/src/models/deberta_v3/deberta_v3_tokenizer.py +0 -15
- keras_hub/src/models/deberta_v3/disentangled_attention_encoder.py +0 -14
- keras_hub/src/models/deberta_v3/disentangled_self_attention.py +0 -14
- keras_hub/src/models/deberta_v3/relative_embedding.py +0 -14
- keras_hub/src/models/densenet/__init__.py +0 -14
- keras_hub/src/models/densenet/densenet_backbone.py +0 -13
- keras_hub/src/models/densenet/densenet_image_classifier.py +0 -13
- keras_hub/src/models/densenet/densenet_image_classifier_preprocessor.py +0 -13
- keras_hub/src/models/densenet/densenet_image_converter.py +0 -13
- keras_hub/src/models/densenet/densenet_presets.py +0 -13
- keras_hub/src/models/distil_bert/__init__.py +0 -14
- keras_hub/src/models/distil_bert/distil_bert_backbone.py +0 -15
- keras_hub/src/models/distil_bert/distil_bert_masked_lm.py +0 -15
- keras_hub/src/models/distil_bert/distil_bert_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/distil_bert/distil_bert_presets.py +0 -13
- keras_hub/src/models/distil_bert/distil_bert_text_classifier.py +0 -15
- keras_hub/src/models/distil_bert/distil_bert_text_classifier_preprocessor.py +0 -15
- keras_hub/src/models/distil_bert/distil_bert_tokenizer.py +0 -15
- keras_hub/src/models/efficientnet/__init__.py +0 -13
- keras_hub/src/models/efficientnet/efficientnet_backbone.py +0 -13
- keras_hub/src/models/efficientnet/fusedmbconv.py +0 -14
- keras_hub/src/models/efficientnet/mbconv.py +0 -14
- keras_hub/src/models/electra/__init__.py +0 -14
- keras_hub/src/models/electra/electra_backbone.py +0 -14
- keras_hub/src/models/electra/electra_presets.py +0 -13
- keras_hub/src/models/electra/electra_tokenizer.py +0 -14
- keras_hub/src/models/f_net/__init__.py +0 -14
- keras_hub/src/models/f_net/f_net_backbone.py +0 -15
- keras_hub/src/models/f_net/f_net_masked_lm.py +0 -15
- keras_hub/src/models/f_net/f_net_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/f_net/f_net_presets.py +0 -13
- keras_hub/src/models/f_net/f_net_text_classifier.py +0 -15
- keras_hub/src/models/f_net/f_net_text_classifier_preprocessor.py +0 -15
- keras_hub/src/models/f_net/f_net_tokenizer.py +0 -15
- keras_hub/src/models/falcon/__init__.py +0 -14
- keras_hub/src/models/falcon/falcon_attention.py +0 -13
- keras_hub/src/models/falcon/falcon_backbone.py +0 -13
- keras_hub/src/models/falcon/falcon_causal_lm.py +0 -14
- keras_hub/src/models/falcon/falcon_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/falcon/falcon_presets.py +0 -13
- keras_hub/src/models/falcon/falcon_tokenizer.py +0 -15
- keras_hub/src/models/falcon/falcon_transformer_decoder.py +0 -13
- keras_hub/src/models/feature_pyramid_backbone.py +0 -13
- keras_hub/src/models/gemma/__init__.py +0 -14
- keras_hub/src/models/gemma/gemma_attention.py +0 -13
- keras_hub/src/models/gemma/gemma_backbone.py +0 -15
- keras_hub/src/models/gemma/gemma_causal_lm.py +0 -15
- keras_hub/src/models/gemma/gemma_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/gemma/gemma_decoder_block.py +0 -13
- keras_hub/src/models/gemma/gemma_presets.py +0 -13
- keras_hub/src/models/gemma/gemma_tokenizer.py +0 -14
- keras_hub/src/models/gemma/rms_normalization.py +0 -14
- keras_hub/src/models/gpt2/__init__.py +0 -14
- keras_hub/src/models/gpt2/gpt2_backbone.py +0 -15
- keras_hub/src/models/gpt2/gpt2_causal_lm.py +0 -15
- keras_hub/src/models/gpt2/gpt2_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/gpt2/gpt2_preprocessor.py +0 -15
- keras_hub/src/models/gpt2/gpt2_presets.py +0 -13
- keras_hub/src/models/gpt2/gpt2_tokenizer.py +0 -15
- keras_hub/src/models/gpt_neo_x/__init__.py +0 -13
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_attention.py +0 -14
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_backbone.py +0 -14
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_causal_lm.py +0 -14
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_decoder.py +0 -14
- keras_hub/src/models/gpt_neo_x/gpt_neo_x_tokenizer.py +0 -14
- keras_hub/src/models/image_classifier.py +0 -13
- keras_hub/src/models/image_classifier_preprocessor.py +0 -13
- keras_hub/src/models/image_segmenter.py +0 -13
- keras_hub/src/models/llama/__init__.py +0 -14
- keras_hub/src/models/llama/llama_attention.py +0 -13
- keras_hub/src/models/llama/llama_backbone.py +0 -13
- keras_hub/src/models/llama/llama_causal_lm.py +0 -13
- keras_hub/src/models/llama/llama_causal_lm_preprocessor.py +0 -15
- keras_hub/src/models/llama/llama_decoder.py +0 -13
- keras_hub/src/models/llama/llama_layernorm.py +0 -13
- keras_hub/src/models/llama/llama_presets.py +0 -13
- keras_hub/src/models/llama/llama_tokenizer.py +0 -14
- keras_hub/src/models/llama3/__init__.py +0 -14
- keras_hub/src/models/llama3/llama3_backbone.py +0 -14
- keras_hub/src/models/llama3/llama3_causal_lm.py +0 -13
- keras_hub/src/models/llama3/llama3_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/llama3/llama3_presets.py +0 -13
- keras_hub/src/models/llama3/llama3_tokenizer.py +0 -14
- keras_hub/src/models/masked_lm.py +0 -13
- keras_hub/src/models/masked_lm_preprocessor.py +0 -13
- keras_hub/src/models/mistral/__init__.py +0 -14
- keras_hub/src/models/mistral/mistral_attention.py +0 -13
- keras_hub/src/models/mistral/mistral_backbone.py +0 -14
- keras_hub/src/models/mistral/mistral_causal_lm.py +0 -14
- keras_hub/src/models/mistral/mistral_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/mistral/mistral_layer_norm.py +0 -13
- keras_hub/src/models/mistral/mistral_presets.py +0 -13
- keras_hub/src/models/mistral/mistral_tokenizer.py +0 -14
- keras_hub/src/models/mistral/mistral_transformer_decoder.py +0 -13
- keras_hub/src/models/mix_transformer/__init__.py +0 -13
- keras_hub/src/models/mix_transformer/mix_transformer_backbone.py +0 -13
- keras_hub/src/models/mix_transformer/mix_transformer_classifier.py +0 -13
- keras_hub/src/models/mix_transformer/mix_transformer_layers.py +0 -13
- keras_hub/src/models/mobilenet/__init__.py +0 -13
- keras_hub/src/models/mobilenet/mobilenet_backbone.py +0 -13
- keras_hub/src/models/mobilenet/mobilenet_image_classifier.py +0 -13
- keras_hub/src/models/opt/__init__.py +0 -14
- keras_hub/src/models/opt/opt_backbone.py +0 -15
- keras_hub/src/models/opt/opt_causal_lm.py +0 -15
- keras_hub/src/models/opt/opt_causal_lm_preprocessor.py +0 -13
- keras_hub/src/models/opt/opt_presets.py +0 -13
- keras_hub/src/models/opt/opt_tokenizer.py +0 -15
- keras_hub/src/models/pali_gemma/__init__.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_backbone.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_causal_lm.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_causal_lm_preprocessor.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_decoder_block.py +0 -14
- keras_hub/src/models/pali_gemma/pali_gemma_image_converter.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_presets.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_tokenizer.py +0 -13
- keras_hub/src/models/pali_gemma/pali_gemma_vit.py +0 -13
- keras_hub/src/models/phi3/__init__.py +0 -14
- keras_hub/src/models/phi3/phi3_attention.py +0 -13
- keras_hub/src/models/phi3/phi3_backbone.py +0 -13
- keras_hub/src/models/phi3/phi3_causal_lm.py +0 -13
- keras_hub/src/models/phi3/phi3_causal_lm_preprocessor.py +0 -14
- keras_hub/src/models/phi3/phi3_decoder.py +0 -13
- keras_hub/src/models/phi3/phi3_layernorm.py +0 -13
- keras_hub/src/models/phi3/phi3_presets.py +0 -13
- keras_hub/src/models/phi3/phi3_rotary_embedding.py +0 -13
- keras_hub/src/models/phi3/phi3_tokenizer.py +0 -13
- keras_hub/src/models/preprocessor.py +51 -32
- keras_hub/src/models/resnet/__init__.py +0 -14
- keras_hub/src/models/resnet/resnet_backbone.py +0 -13
- keras_hub/src/models/resnet/resnet_image_classifier.py +0 -13
- keras_hub/src/models/resnet/resnet_image_classifier_preprocessor.py +0 -14
- keras_hub/src/models/resnet/resnet_image_converter.py +0 -13
- keras_hub/src/models/resnet/resnet_presets.py +0 -13
- keras_hub/src/models/retinanet/__init__.py +0 -13
- keras_hub/src/models/retinanet/anchor_generator.py +28 -30
- keras_hub/src/models/retinanet/box_matcher.py +0 -14
- keras_hub/src/models/retinanet/feature_pyramid.py +373 -0
- keras_hub/src/models/retinanet/non_max_supression.py +0 -14
- keras_hub/src/models/retinanet/retinanet_label_encoder.py +270 -0
- keras_hub/src/models/roberta/__init__.py +0 -14
- keras_hub/src/models/roberta/roberta_backbone.py +0 -15
- keras_hub/src/models/roberta/roberta_masked_lm.py +0 -15
- keras_hub/src/models/roberta/roberta_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/roberta/roberta_presets.py +0 -13
- keras_hub/src/models/roberta/roberta_text_classifier.py +0 -15
- keras_hub/src/models/roberta/roberta_text_classifier_preprocessor.py +0 -14
- keras_hub/src/models/roberta/roberta_tokenizer.py +0 -15
- keras_hub/src/models/sam/__init__.py +0 -13
- keras_hub/src/models/sam/sam_backbone.py +0 -14
- keras_hub/src/models/sam/sam_image_segmenter.py +0 -14
- keras_hub/src/models/sam/sam_layers.py +0 -14
- keras_hub/src/models/sam/sam_mask_decoder.py +0 -14
- keras_hub/src/models/sam/sam_prompt_encoder.py +0 -14
- keras_hub/src/models/sam/sam_transformer.py +0 -14
- keras_hub/src/models/seq_2_seq_lm.py +0 -13
- keras_hub/src/models/seq_2_seq_lm_preprocessor.py +0 -13
- keras_hub/src/models/stable_diffusion_3/__init__.py +9 -13
- keras_hub/src/models/stable_diffusion_3/flow_match_euler_discrete_scheduler.py +0 -13
- keras_hub/src/models/stable_diffusion_3/mmdit.py +0 -13
- keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_backbone.py +15 -14
- keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_presets.py +18 -0
- keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image.py +0 -13
- keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image_preprocessor.py +23 -17
- keras_hub/src/models/stable_diffusion_3/t5_encoder.py +0 -13
- keras_hub/src/models/stable_diffusion_3/vae_image_decoder.py +0 -13
- keras_hub/src/models/t5/__init__.py +0 -14
- keras_hub/src/models/t5/t5_backbone.py +0 -14
- keras_hub/src/models/t5/t5_layer_norm.py +0 -14
- keras_hub/src/models/t5/t5_multi_head_attention.py +0 -14
- keras_hub/src/models/t5/t5_preprocessor.py +0 -13
- keras_hub/src/models/t5/t5_presets.py +0 -13
- keras_hub/src/models/t5/t5_tokenizer.py +0 -14
- keras_hub/src/models/t5/t5_transformer_layer.py +0 -14
- keras_hub/src/models/task.py +0 -14
- keras_hub/src/models/text_classifier.py +0 -13
- keras_hub/src/models/text_classifier_preprocessor.py +0 -13
- keras_hub/src/models/text_to_image.py +0 -13
- keras_hub/src/models/vgg/__init__.py +0 -13
- keras_hub/src/models/vgg/vgg_backbone.py +0 -13
- keras_hub/src/models/vgg/vgg_image_classifier.py +0 -13
- keras_hub/src/models/vit_det/__init__.py +0 -13
- keras_hub/src/models/vit_det/vit_det_backbone.py +0 -14
- keras_hub/src/models/vit_det/vit_layers.py +0 -15
- keras_hub/src/models/whisper/__init__.py +0 -14
- keras_hub/src/models/whisper/whisper_audio_converter.py +0 -15
- keras_hub/src/models/whisper/whisper_backbone.py +0 -15
- keras_hub/src/models/whisper/whisper_cached_multi_head_attention.py +0 -13
- keras_hub/src/models/whisper/whisper_decoder.py +0 -14
- keras_hub/src/models/whisper/whisper_encoder.py +0 -14
- keras_hub/src/models/whisper/whisper_presets.py +0 -14
- keras_hub/src/models/whisper/whisper_tokenizer.py +0 -14
- keras_hub/src/models/xlm_roberta/__init__.py +0 -14
- keras_hub/src/models/xlm_roberta/xlm_roberta_backbone.py +0 -15
- keras_hub/src/models/xlm_roberta/xlm_roberta_masked_lm.py +0 -15
- keras_hub/src/models/xlm_roberta/xlm_roberta_masked_lm_preprocessor.py +0 -14
- keras_hub/src/models/xlm_roberta/xlm_roberta_presets.py +0 -13
- keras_hub/src/models/xlm_roberta/xlm_roberta_text_classifier.py +0 -15
- keras_hub/src/models/xlm_roberta/xlm_roberta_text_classifier_preprocessor.py +0 -15
- keras_hub/src/models/xlm_roberta/xlm_roberta_tokenizer.py +0 -15
- keras_hub/src/models/xlnet/__init__.py +0 -13
- keras_hub/src/models/xlnet/relative_attention.py +0 -14
- keras_hub/src/models/xlnet/xlnet_backbone.py +0 -14
- keras_hub/src/models/xlnet/xlnet_content_and_query_embedding.py +0 -14
- keras_hub/src/models/xlnet/xlnet_encoder.py +0 -14
- keras_hub/src/samplers/__init__.py +0 -13
- keras_hub/src/samplers/beam_sampler.py +0 -14
- keras_hub/src/samplers/contrastive_sampler.py +0 -14
- keras_hub/src/samplers/greedy_sampler.py +0 -14
- keras_hub/src/samplers/random_sampler.py +0 -14
- keras_hub/src/samplers/sampler.py +0 -14
- keras_hub/src/samplers/serialization.py +0 -14
- keras_hub/src/samplers/top_k_sampler.py +0 -14
- keras_hub/src/samplers/top_p_sampler.py +0 -14
- keras_hub/src/tests/__init__.py +0 -13
- keras_hub/src/tests/test_case.py +23 -20
- keras_hub/src/tokenizers/__init__.py +0 -13
- keras_hub/src/tokenizers/byte_pair_tokenizer.py +0 -14
- keras_hub/src/tokenizers/byte_tokenizer.py +0 -14
- keras_hub/src/tokenizers/sentence_piece_tokenizer.py +0 -14
- keras_hub/src/tokenizers/sentence_piece_tokenizer_trainer.py +0 -14
- keras_hub/src/tokenizers/tokenizer.py +23 -27
- keras_hub/src/tokenizers/unicode_codepoint_tokenizer.py +0 -15
- keras_hub/src/tokenizers/word_piece_tokenizer.py +0 -14
- keras_hub/src/tokenizers/word_piece_tokenizer_trainer.py +0 -15
- keras_hub/src/utils/__init__.py +0 -13
- keras_hub/src/utils/imagenet/__init__.py +0 -13
- keras_hub/src/utils/imagenet/imagenet_utils.py +0 -13
- keras_hub/src/utils/keras_utils.py +0 -14
- keras_hub/src/utils/pipeline_model.py +0 -14
- keras_hub/src/utils/preset_utils.py +32 -76
- keras_hub/src/utils/python_utils.py +0 -13
- keras_hub/src/utils/tensor_utils.py +106 -14
- keras_hub/src/utils/timm/__init__.py +0 -13
- keras_hub/src/utils/timm/convert_densenet.py +0 -13
- keras_hub/src/utils/timm/convert_resnet.py +0 -13
- keras_hub/src/utils/timm/preset_loader.py +0 -13
- keras_hub/src/utils/transformers/__init__.py +0 -13
- keras_hub/src/utils/transformers/convert_albert.py +0 -13
- keras_hub/src/utils/transformers/convert_bart.py +0 -13
- keras_hub/src/utils/transformers/convert_bert.py +0 -13
- keras_hub/src/utils/transformers/convert_distilbert.py +0 -13
- keras_hub/src/utils/transformers/convert_gemma.py +0 -13
- keras_hub/src/utils/transformers/convert_gpt2.py +0 -13
- keras_hub/src/utils/transformers/convert_llama3.py +0 -13
- keras_hub/src/utils/transformers/convert_mistral.py +0 -13
- keras_hub/src/utils/transformers/convert_pali_gemma.py +0 -13
- keras_hub/src/utils/transformers/preset_loader.py +1 -15
- keras_hub/src/utils/transformers/safetensor_utils.py +9 -15
- keras_hub/src/version_utils.py +1 -15
- {keras_hub_nightly-0.16.1.dev202409260340.dist-info → keras_hub_nightly-0.16.1.dev202409280337.dist-info}/METADATA +30 -27
- keras_hub_nightly-0.16.1.dev202409280337.dist-info/RECORD +353 -0
- keras_hub_nightly-0.16.1.dev202409260340.dist-info/RECORD +0 -350
- {keras_hub_nightly-0.16.1.dev202409260340.dist-info → keras_hub_nightly-0.16.1.dev202409280337.dist-info}/WHEEL +0 -0
- {keras_hub_nightly-0.16.1.dev202409260340.dist-info → keras_hub_nightly-0.16.1.dev202409280337.dist-info}/top_level.txt +0 -0
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
from keras import ops
|
16
2
|
from keras import tree
|
17
3
|
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
from keras import ops
|
16
2
|
|
17
3
|
from keras_hub.src.api_export import keras_hub_export
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
from keras import ops
|
16
2
|
from keras import random
|
17
3
|
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import keras
|
16
2
|
from keras import ops
|
17
3
|
from keras import random
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import keras
|
16
2
|
|
17
3
|
from keras_hub.src.api_export import keras_hub_export
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
from keras import ops
|
16
2
|
from keras import random
|
17
3
|
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
from keras import ops
|
16
2
|
from keras import random
|
17
3
|
|
keras_hub/src/tests/__init__.py
CHANGED
@@ -1,13 +0,0 @@
|
|
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.
|
keras_hub/src/tests/test_case.py
CHANGED
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import json
|
16
2
|
import os
|
17
3
|
import pathlib
|
@@ -27,6 +13,7 @@ from keras import tree
|
|
27
13
|
from keras_hub.src.layers.modeling.reversible_embedding import (
|
28
14
|
ReversibleEmbedding,
|
29
15
|
)
|
16
|
+
from keras_hub.src.models.retinanet.feature_pyramid import FeaturePyramid
|
30
17
|
from keras_hub.src.tokenizers.tokenizer import Tokenizer
|
31
18
|
from keras_hub.src.utils.keras_utils import has_quantization_support
|
32
19
|
from keras_hub.src.utils.tensor_utils import is_float_dtype
|
@@ -141,7 +128,10 @@ class TestCase(tf.test.TestCase, parameterized.TestCase):
|
|
141
128
|
|
142
129
|
def call(self, x):
|
143
130
|
if isinstance(x, dict):
|
144
|
-
|
131
|
+
if isinstance(layer, FeaturePyramid):
|
132
|
+
return self.layer(x)
|
133
|
+
else:
|
134
|
+
return self.layer(**x)
|
145
135
|
else:
|
146
136
|
return self.layer(x)
|
147
137
|
|
@@ -161,7 +151,10 @@ class TestCase(tf.test.TestCase, parameterized.TestCase):
|
|
161
151
|
layer = cls(**init_kwargs)
|
162
152
|
if isinstance(input_data, dict):
|
163
153
|
shapes = {k + "_shape": v.shape for k, v in input_data.items()}
|
164
|
-
layer
|
154
|
+
if isinstance(layer, FeaturePyramid):
|
155
|
+
layer.build(shapes)
|
156
|
+
else:
|
157
|
+
layer.build(**shapes)
|
165
158
|
else:
|
166
159
|
layer.build(input_data.shape)
|
167
160
|
run_build_asserts(layer)
|
@@ -172,7 +165,10 @@ class TestCase(tf.test.TestCase, parameterized.TestCase):
|
|
172
165
|
)
|
173
166
|
layer = cls(**init_kwargs)
|
174
167
|
if isinstance(keras_tensor_inputs, dict):
|
175
|
-
|
168
|
+
if isinstance(layer, FeaturePyramid):
|
169
|
+
keras_tensor_outputs = layer(keras_tensor_inputs)
|
170
|
+
else:
|
171
|
+
keras_tensor_outputs = layer(**keras_tensor_inputs)
|
176
172
|
else:
|
177
173
|
keras_tensor_outputs = layer(keras_tensor_inputs)
|
178
174
|
run_build_asserts(layer)
|
@@ -181,7 +177,10 @@ class TestCase(tf.test.TestCase, parameterized.TestCase):
|
|
181
177
|
# Eager call test and compiled training test.
|
182
178
|
layer = cls(**init_kwargs)
|
183
179
|
if isinstance(input_data, dict):
|
184
|
-
|
180
|
+
if isinstance(layer, FeaturePyramid):
|
181
|
+
output_data = layer(input_data)
|
182
|
+
else:
|
183
|
+
output_data = layer(**input_data)
|
185
184
|
else:
|
186
185
|
output_data = layer(input_data)
|
187
186
|
run_output_asserts(layer, output_data, eager=True)
|
@@ -319,8 +318,12 @@ class TestCase(tf.test.TestCase, parameterized.TestCase):
|
|
319
318
|
output_data = layer(input_data)
|
320
319
|
output_spec = layer.compute_output_spec(input_data)
|
321
320
|
elif isinstance(input_data, dict):
|
322
|
-
|
323
|
-
|
321
|
+
if isinstance(layer, FeaturePyramid):
|
322
|
+
output_data = layer(input_data)
|
323
|
+
output_spec = layer.compute_output_spec(input_data)
|
324
|
+
else:
|
325
|
+
output_data = layer(**input_data)
|
326
|
+
output_spec = layer.compute_output_spec(**input_data)
|
324
327
|
else:
|
325
328
|
output_data = layer(input_data)
|
326
329
|
output_spec = layer.compute_output_spec(input_data)
|
@@ -1,13 +0,0 @@
|
|
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.
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
"""Byte-pair encoder implementation.
|
16
2
|
|
17
3
|
This file implements the same logic as openai BPE:
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import numpy as np
|
16
2
|
|
17
3
|
try:
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import base64
|
16
2
|
import binascii
|
17
3
|
import os
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import io
|
16
2
|
|
17
3
|
try:
|
@@ -1,30 +1,16 @@
|
|
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
1
|
import os
|
15
2
|
|
16
3
|
from keras_hub.src.api_export import keras_hub_export
|
17
4
|
from keras_hub.src.layers.preprocessing.preprocessing_layer import (
|
18
5
|
PreprocessingLayer,
|
19
6
|
)
|
20
|
-
from keras_hub.src.utils.preset_utils import
|
7
|
+
from keras_hub.src.utils.preset_utils import ASSET_DIR
|
21
8
|
from keras_hub.src.utils.preset_utils import TOKENIZER_CONFIG_FILE
|
22
9
|
from keras_hub.src.utils.preset_utils import builtin_presets
|
23
10
|
from keras_hub.src.utils.preset_utils import find_subclass
|
24
11
|
from keras_hub.src.utils.preset_utils import get_file
|
25
12
|
from keras_hub.src.utils.preset_utils import get_preset_loader
|
26
13
|
from keras_hub.src.utils.preset_utils import save_serialized_object
|
27
|
-
from keras_hub.src.utils.preset_utils import save_tokenizer_assets
|
28
14
|
from keras_hub.src.utils.python_utils import classproperty
|
29
15
|
from keras_hub.src.utils.tensor_utils import preprocessing_function
|
30
16
|
|
@@ -80,6 +66,7 @@ class Tokenizer(PreprocessingLayer):
|
|
80
66
|
backbone_cls = None
|
81
67
|
|
82
68
|
def __init__(self, *args, **kwargs):
|
69
|
+
self.config_name = kwargs.pop("config_name", TOKENIZER_CONFIG_FILE)
|
83
70
|
super().__init__(*args, **kwargs)
|
84
71
|
self.file_assets = None
|
85
72
|
|
@@ -187,18 +174,26 @@ class Tokenizer(PreprocessingLayer):
|
|
187
174
|
token = getattr(self, attr)
|
188
175
|
setattr(self, f"{attr}_id", self.token_to_id(token))
|
189
176
|
|
177
|
+
def get_config(self):
|
178
|
+
config = super().get_config()
|
179
|
+
config.update(
|
180
|
+
{
|
181
|
+
"config_name": self.config_name,
|
182
|
+
}
|
183
|
+
)
|
184
|
+
return config
|
185
|
+
|
190
186
|
def save_to_preset(self, preset_dir):
|
191
187
|
"""Save tokenizer to a preset directory.
|
192
188
|
|
193
189
|
Args:
|
194
190
|
preset_dir: The path to the local model preset directory.
|
195
191
|
"""
|
196
|
-
save_serialized_object(
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
)
|
201
|
-
save_tokenizer_assets(self, preset_dir)
|
192
|
+
save_serialized_object(self, preset_dir, config_file=self.config_name)
|
193
|
+
subdir = self.config_name.split(".")[0]
|
194
|
+
asset_dir = os.path.join(preset_dir, ASSET_DIR, subdir)
|
195
|
+
os.makedirs(asset_dir, exist_ok=True)
|
196
|
+
self.save_assets(asset_dir)
|
202
197
|
|
203
198
|
@preprocessing_function
|
204
199
|
def call(self, inputs, *args, training=None, **kwargs):
|
@@ -207,11 +202,11 @@ class Tokenizer(PreprocessingLayer):
|
|
207
202
|
def load_preset_assets(self, preset):
|
208
203
|
asset_path = None
|
209
204
|
for asset in self.file_assets:
|
210
|
-
|
211
|
-
|
212
|
-
)
|
213
|
-
|
214
|
-
self.load_assets(
|
205
|
+
subdir = self.config_name.split(".")[0]
|
206
|
+
preset_path = os.path.join(ASSET_DIR, subdir, asset)
|
207
|
+
asset_path = get_file(preset, preset_path)
|
208
|
+
tokenizer_config_name = os.path.dirname(asset_path)
|
209
|
+
self.load_assets(tokenizer_config_name)
|
215
210
|
|
216
211
|
@classproperty
|
217
212
|
def presets(cls):
|
@@ -222,6 +217,7 @@ class Tokenizer(PreprocessingLayer):
|
|
222
217
|
def from_preset(
|
223
218
|
cls,
|
224
219
|
preset,
|
220
|
+
config_name=TOKENIZER_CONFIG_FILE,
|
225
221
|
**kwargs,
|
226
222
|
):
|
227
223
|
"""Instantiate a `keras_hub.models.Tokenizer` from a model preset.
|
@@ -267,4 +263,4 @@ class Tokenizer(PreprocessingLayer):
|
|
267
263
|
backbone_cls = loader.check_backbone_class()
|
268
264
|
if cls.backbone_cls != backbone_cls:
|
269
265
|
cls = find_subclass(preset, cls, backbone_cls)
|
270
|
-
return loader.load_tokenizer(cls, **kwargs)
|
266
|
+
return loader.load_tokenizer(cls, config_name, **kwargs)
|
@@ -1,18 +1,3 @@
|
|
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
|
-
|
15
|
-
|
16
1
|
from keras_hub.src.api_export import keras_hub_export
|
17
2
|
from keras_hub.src.tokenizers import tokenizer
|
18
3
|
from keras_hub.src.utils.tensor_utils import convert_to_ragged_batch
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import os
|
16
2
|
import re
|
17
3
|
from typing import Iterable
|
@@ -1,18 +1,3 @@
|
|
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
|
-
|
15
|
-
|
16
1
|
from keras_hub.src.api_export import keras_hub_export
|
17
2
|
from keras_hub.src.tokenizers.word_piece_tokenizer import pretokenize
|
18
3
|
|
keras_hub/src/utils/__init__.py
CHANGED
@@ -1,13 +0,0 @@
|
|
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.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Copyright 2024 The KerasNLP 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.
|
@@ -1,16 +1,3 @@
|
|
1
|
-
# Copyright 2024 The KerasNLP 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
1
|
from keras import ops
|
15
2
|
|
16
3
|
from keras_hub.src.api_export import keras_hub_export
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import sys
|
16
2
|
|
17
3
|
import keras
|
@@ -1,17 +1,3 @@
|
|
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
|
-
|
15
1
|
import functools
|
16
2
|
import math
|
17
3
|
|