keras-nlp-nightly 0.13.0.dev2024070403__tar.gz → 0.24.0.dev202511230433__tar.gz

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.

Potentially problematic release.


This version of keras-nlp-nightly might be problematic. Click here for more details.

Files changed (282) hide show
  1. keras_nlp_nightly-0.24.0.dev202511230433/PKG-INFO +31 -0
  2. keras_nlp_nightly-0.24.0.dev202511230433/README.md +7 -0
  3. keras_nlp_nightly-0.24.0.dev202511230433/keras_nlp/__init__.py +13 -0
  4. keras_nlp_nightly-0.24.0.dev202511230433/keras_nlp_nightly.egg-info/PKG-INFO +31 -0
  5. keras_nlp_nightly-0.24.0.dev202511230433/keras_nlp_nightly.egg-info/SOURCES.txt +8 -0
  6. keras_nlp_nightly-0.24.0.dev202511230433/keras_nlp_nightly.egg-info/requires.txt +1 -0
  7. keras_nlp_nightly-0.24.0.dev202511230433/pyproject.toml +33 -0
  8. keras_nlp_nightly-0.24.0.dev202511230433/setup.cfg +4 -0
  9. keras_nlp_nightly-0.13.0.dev2024070403/PKG-INFO +0 -196
  10. keras_nlp_nightly-0.13.0.dev2024070403/README.md +0 -162
  11. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/__init__.py +0 -46
  12. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/__init__.py +0 -27
  13. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/layers/__init__.py +0 -47
  14. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/metrics/__init__.py +0 -24
  15. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/models/__init__.py +0 -224
  16. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/samplers/__init__.py +0 -29
  17. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/api/tokenizers/__init__.py +0 -35
  18. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/__init__.py +0 -31
  19. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/api_export.py +0 -48
  20. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/__init__.py +0 -41
  21. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/__init__.py +0 -13
  22. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/alibi_bias.py +0 -143
  23. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/cached_multi_head_attention.py +0 -151
  24. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/f_net_encoder.py +0 -200
  25. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/masked_lm_head.py +0 -239
  26. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/position_embedding.py +0 -123
  27. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/reversible_embedding.py +0 -276
  28. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/rotary_embedding.py +0 -169
  29. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/sine_position_encoding.py +0 -108
  30. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/token_and_position_embedding.py +0 -150
  31. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/transformer_decoder.py +0 -496
  32. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/transformer_encoder.py +0 -262
  33. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/modeling/transformer_layer_utils.py +0 -106
  34. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/__init__.py +0 -13
  35. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/masked_lm_mask_generator.py +0 -228
  36. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/multi_segment_packer.py +0 -328
  37. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/preprocessing_layer.py +0 -61
  38. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/random_deletion.py +0 -274
  39. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/random_swap.py +0 -270
  40. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/layers/preprocessing/start_end_packer.py +0 -221
  41. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/__init__.py +0 -19
  42. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/bleu.py +0 -396
  43. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/edit_distance.py +0 -200
  44. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/perplexity.py +0 -181
  45. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/rouge_base.py +0 -207
  46. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/rouge_l.py +0 -97
  47. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/metrics/rouge_n.py +0 -125
  48. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/__init__.py +0 -196
  49. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/__init__.py +0 -20
  50. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_backbone.py +0 -267
  51. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_classifier.py +0 -202
  52. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_masked_lm.py +0 -129
  53. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_masked_lm_preprocessor.py +0 -194
  54. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_preprocessor.py +0 -206
  55. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_presets.py +0 -70
  56. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/albert/albert_tokenizer.py +0 -119
  57. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/backbone.py +0 -287
  58. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/__init__.py +0 -20
  59. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_backbone.py +0 -261
  60. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_preprocessor.py +0 -276
  61. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_presets.py +0 -74
  62. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_seq_2_seq_lm.py +0 -490
  63. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_seq_2_seq_lm_preprocessor.py +0 -271
  64. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bart/bart_tokenizer.py +0 -124
  65. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/__init__.py +0 -23
  66. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_backbone.py +0 -227
  67. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_classifier.py +0 -183
  68. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_masked_lm.py +0 -131
  69. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_masked_lm_preprocessor.py +0 -198
  70. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_preprocessor.py +0 -184
  71. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_presets.py +0 -147
  72. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bert/bert_tokenizer.py +0 -112
  73. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/__init__.py +0 -20
  74. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_attention.py +0 -186
  75. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_backbone.py +0 -173
  76. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_causal_lm.py +0 -298
  77. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_causal_lm_preprocessor.py +0 -188
  78. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_decoder.py +0 -206
  79. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_preprocessor.py +0 -185
  80. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_presets.py +0 -121
  81. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/bloom/bloom_tokenizer.py +0 -116
  82. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/causal_lm.py +0 -385
  83. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/classifier.py +0 -109
  84. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/__init__.py +0 -24
  85. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_backbone.py +0 -210
  86. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_classifier.py +0 -228
  87. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_masked_lm.py +0 -135
  88. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_masked_lm_preprocessor.py +0 -191
  89. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_preprocessor.py +0 -206
  90. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_presets.py +0 -82
  91. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/deberta_v3_tokenizer.py +0 -158
  92. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/disentangled_attention_encoder.py +0 -227
  93. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/disentangled_self_attention.py +0 -412
  94. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/deberta_v3/relative_embedding.py +0 -94
  95. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/__init__.py +0 -26
  96. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_backbone.py +0 -187
  97. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_classifier.py +0 -208
  98. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_masked_lm.py +0 -137
  99. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_masked_lm_preprocessor.py +0 -194
  100. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_preprocessor.py +0 -175
  101. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_presets.py +0 -57
  102. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/distil_bert/distil_bert_tokenizer.py +0 -114
  103. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/electra/__init__.py +0 -20
  104. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/electra/electra_backbone.py +0 -247
  105. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/electra/electra_preprocessor.py +0 -154
  106. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/electra/electra_presets.py +0 -95
  107. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/electra/electra_tokenizer.py +0 -104
  108. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/__init__.py +0 -20
  109. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_backbone.py +0 -236
  110. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_classifier.py +0 -154
  111. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_masked_lm.py +0 -132
  112. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_masked_lm_preprocessor.py +0 -196
  113. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_preprocessor.py +0 -177
  114. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_presets.py +0 -43
  115. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/f_net/f_net_tokenizer.py +0 -95
  116. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/__init__.py +0 -20
  117. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_attention.py +0 -156
  118. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_backbone.py +0 -164
  119. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_causal_lm.py +0 -291
  120. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_causal_lm_preprocessor.py +0 -184
  121. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_preprocessor.py +0 -187
  122. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_presets.py +0 -30
  123. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_tokenizer.py +0 -110
  124. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/falcon/falcon_transformer_decoder.py +0 -255
  125. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/__init__.py +0 -20
  126. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_attention.py +0 -237
  127. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_backbone.py +0 -315
  128. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_causal_lm.py +0 -455
  129. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_causal_lm_preprocessor.py +0 -176
  130. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_decoder_block.py +0 -241
  131. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_preprocessor.py +0 -191
  132. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_presets.py +0 -198
  133. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/gemma_tokenizer.py +0 -103
  134. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gemma/rms_normalization.py +0 -40
  135. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/__init__.py +0 -20
  136. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_backbone.py +0 -199
  137. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_causal_lm.py +0 -437
  138. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_causal_lm_preprocessor.py +0 -184
  139. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_preprocessor.py +0 -187
  140. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_presets.py +0 -82
  141. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt2/gpt2_tokenizer.py +0 -110
  142. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/__init__.py +0 -13
  143. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_attention.py +0 -251
  144. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_backbone.py +0 -175
  145. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_causal_lm.py +0 -201
  146. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_causal_lm_preprocessor.py +0 -154
  147. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_decoder.py +0 -258
  148. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_preprocessor.py +0 -145
  149. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/gpt_neo_x/gpt_neo_x_tokenizer.py +0 -88
  150. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/__init__.py +0 -20
  151. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_attention.py +0 -225
  152. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_backbone.py +0 -188
  153. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_causal_lm.py +0 -327
  154. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_causal_lm_preprocessor.py +0 -191
  155. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_decoder.py +0 -246
  156. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_layernorm.py +0 -48
  157. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_preprocessor.py +0 -189
  158. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_presets.py +0 -38
  159. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama/llama_tokenizer.py +0 -84
  160. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/__init__.py +0 -20
  161. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_backbone.py +0 -84
  162. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_causal_lm.py +0 -46
  163. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_causal_lm_preprocessor.py +0 -185
  164. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_preprocessor.py +0 -21
  165. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_presets.py +0 -38
  166. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/llama3/llama3_tokenizer.py +0 -63
  167. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/masked_lm.py +0 -101
  168. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/__init__.py +0 -20
  169. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_attention.py +0 -238
  170. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_backbone.py +0 -203
  171. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_causal_lm.py +0 -328
  172. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_causal_lm_preprocessor.py +0 -193
  173. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_layer_norm.py +0 -48
  174. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_preprocessor.py +0 -190
  175. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_presets.py +0 -48
  176. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_tokenizer.py +0 -82
  177. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/mistral/mistral_transformer_decoder.py +0 -265
  178. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/__init__.py +0 -20
  179. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_backbone.py +0 -169
  180. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_causal_lm.py +0 -301
  181. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_causal_lm_preprocessor.py +0 -186
  182. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_preprocessor.py +0 -188
  183. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_presets.py +0 -72
  184. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/opt/opt_tokenizer.py +0 -116
  185. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/__init__.py +0 -23
  186. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_backbone.py +0 -277
  187. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_causal_lm.py +0 -313
  188. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_causal_lm_preprocessor.py +0 -154
  189. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_decoder_block.py +0 -160
  190. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_presets.py +0 -78
  191. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_tokenizer.py +0 -79
  192. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/pali_gemma/pali_gemma_vit.py +0 -559
  193. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/__init__.py +0 -20
  194. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_attention.py +0 -260
  195. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_backbone.py +0 -224
  196. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_causal_lm.py +0 -218
  197. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_causal_lm_preprocessor.py +0 -191
  198. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_decoder.py +0 -260
  199. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_layernorm.py +0 -48
  200. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_preprocessor.py +0 -190
  201. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_presets.py +0 -50
  202. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_rotary_embedding.py +0 -137
  203. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/phi3/phi3_tokenizer.py +0 -94
  204. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/preprocessor.py +0 -207
  205. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/__init__.py +0 -20
  206. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_backbone.py +0 -184
  207. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_classifier.py +0 -209
  208. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_masked_lm.py +0 -136
  209. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_masked_lm_preprocessor.py +0 -198
  210. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_preprocessor.py +0 -192
  211. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_presets.py +0 -43
  212. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/roberta/roberta_tokenizer.py +0 -132
  213. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/seq_2_seq_lm.py +0 -54
  214. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/__init__.py +0 -20
  215. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_backbone.py +0 -261
  216. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_layer_norm.py +0 -35
  217. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_multi_head_attention.py +0 -324
  218. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_presets.py +0 -95
  219. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_tokenizer.py +0 -100
  220. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/t5/t5_transformer_layer.py +0 -178
  221. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/task.py +0 -421
  222. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/__init__.py +0 -20
  223. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_audio_feature_extractor.py +0 -260
  224. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_backbone.py +0 -305
  225. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_cached_multi_head_attention.py +0 -154
  226. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_decoder.py +0 -141
  227. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_encoder.py +0 -106
  228. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_preprocessor.py +0 -326
  229. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_presets.py +0 -148
  230. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/whisper/whisper_tokenizer.py +0 -163
  231. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/__init__.py +0 -26
  232. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_backbone.py +0 -81
  233. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_classifier.py +0 -225
  234. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_masked_lm.py +0 -141
  235. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_masked_lm_preprocessor.py +0 -195
  236. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_preprocessor.py +0 -205
  237. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_presets.py +0 -43
  238. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlm_roberta/xlm_roberta_tokenizer.py +0 -194
  239. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlnet/__init__.py +0 -13
  240. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlnet/relative_attention.py +0 -459
  241. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlnet/xlnet_backbone.py +0 -222
  242. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlnet/xlnet_content_and_query_embedding.py +0 -133
  243. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/models/xlnet/xlnet_encoder.py +0 -377
  244. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/__init__.py +0 -26
  245. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/beam_sampler.py +0 -211
  246. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/contrastive_sampler.py +0 -231
  247. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/greedy_sampler.py +0 -50
  248. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/random_sampler.py +0 -77
  249. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/sampler.py +0 -237
  250. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/serialization.py +0 -97
  251. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/top_k_sampler.py +0 -92
  252. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/samplers/top_p_sampler.py +0 -113
  253. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tests/__init__.py +0 -13
  254. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tests/test_case.py +0 -527
  255. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/__init__.py +0 -30
  256. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/byte_pair_tokenizer.py +0 -648
  257. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/byte_tokenizer.py +0 -302
  258. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/sentence_piece_tokenizer.py +0 -270
  259. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/sentence_piece_tokenizer_trainer.py +0 -150
  260. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/tokenizer.py +0 -235
  261. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/unicode_codepoint_tokenizer.py +0 -357
  262. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/word_piece_tokenizer.py +0 -553
  263. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/tokenizers/word_piece_tokenizer_trainer.py +0 -184
  264. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/__init__.py +0 -13
  265. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/keras_utils.py +0 -106
  266. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/pipeline_model.py +0 -295
  267. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/preset_utils.py +0 -590
  268. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/python_utils.py +0 -21
  269. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/tensor_utils.py +0 -195
  270. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/transformers/__init__.py +0 -13
  271. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/transformers/convert.py +0 -48
  272. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/transformers/convert_gemma.py +0 -179
  273. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/transformers/convert_llama3.py +0 -206
  274. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/utils/transformers/safetensor_utils.py +0 -44
  275. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp/src/version_utils.py +0 -23
  276. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp_nightly.egg-info/PKG-INFO +0 -196
  277. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp_nightly.egg-info/SOURCES.txt +0 -273
  278. keras_nlp_nightly-0.13.0.dev2024070403/keras_nlp_nightly.egg-info/requires.txt +0 -13
  279. keras_nlp_nightly-0.13.0.dev2024070403/setup.cfg +0 -37
  280. keras_nlp_nightly-0.13.0.dev2024070403/setup.py +0 -94
  281. {keras_nlp_nightly-0.13.0.dev2024070403 → keras_nlp_nightly-0.24.0.dev202511230433}/keras_nlp_nightly.egg-info/dependency_links.txt +0 -0
  282. {keras_nlp_nightly-0.13.0.dev2024070403 → keras_nlp_nightly-0.24.0.dev202511230433}/keras_nlp_nightly.egg-info/top_level.txt +0 -0
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.4
2
+ Name: keras-nlp-nightly
3
+ Version: 0.24.0.dev202511230433
4
+ Summary: Pretrained models for Keras.
5
+ Author-email: Keras team <keras-users@googlegroups.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Home, https://keras.io/keras_hub/
8
+ Project-URL: Repository, https://github.com/keras-team/keras/keras_hub
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: keras-hub-nightly==0.24.0.dev202511230433
24
+
25
+ # KerasNLP: Multi-framework NLP Models
26
+
27
+ KerasNLP has renamed to KerasHub! Read the announcement
28
+ [here](https://github.com/keras-team/keras-nlp/issues/1831).
29
+
30
+ This contains a shim package for `keras-nlp` so that the old style
31
+ `pip install keras-nlp` and `import keras_nlp` continue to work.
@@ -0,0 +1,7 @@
1
+ # KerasNLP: Multi-framework NLP Models
2
+
3
+ KerasNLP has renamed to KerasHub! Read the announcement
4
+ [here](https://github.com/keras-team/keras-nlp/issues/1831).
5
+
6
+ This contains a shim package for `keras-nlp` so that the old style
7
+ `pip install keras-nlp` and `import keras_nlp` continue to work.
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ # Add everything in /api/ to the module search path.
4
+ import keras_hub
5
+
6
+ # Add everything in /api/ to the module search path.
7
+ __path__.extend(keras_hub.__path__) # noqa: F405
8
+
9
+ from keras_hub import * # noqa: F403, E402
10
+ from keras_hub import __version__ as __version__ # noqa: E402
11
+
12
+ # Don't pollute namespace.
13
+ del os
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.4
2
+ Name: keras-nlp-nightly
3
+ Version: 0.24.0.dev202511230433
4
+ Summary: Pretrained models for Keras.
5
+ Author-email: Keras team <keras-users@googlegroups.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Home, https://keras.io/keras_hub/
8
+ Project-URL: Repository, https://github.com/keras-team/keras/keras_hub
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: keras-hub-nightly==0.24.0.dev202511230433
24
+
25
+ # KerasNLP: Multi-framework NLP Models
26
+
27
+ KerasNLP has renamed to KerasHub! Read the announcement
28
+ [here](https://github.com/keras-team/keras-nlp/issues/1831).
29
+
30
+ This contains a shim package for `keras-nlp` so that the old style
31
+ `pip install keras-nlp` and `import keras_nlp` continue to work.
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ keras_nlp/__init__.py
4
+ keras_nlp_nightly.egg-info/PKG-INFO
5
+ keras_nlp_nightly.egg-info/SOURCES.txt
6
+ keras_nlp_nightly.egg-info/dependency_links.txt
7
+ keras_nlp_nightly.egg-info/requires.txt
8
+ keras_nlp_nightly.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ keras-hub-nightly==0.24.0.dev202511230433
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools >=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "keras-nlp-nightly"
7
+ version = "0.24.0.dev202511230433"
8
+ dependencies = ["keras-hub-nightly==0.24.0.dev202511230433"]
9
+ authors = [
10
+ {name = "Keras team", email = "keras-users@googlegroups.com"},
11
+ ]
12
+ description = "Pretrained models for Keras."
13
+ readme = "README.md"
14
+ requires-python = ">=3.10"
15
+ license = "Apache-2.0"
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Operating System :: Unix",
24
+ "Operating System :: Microsoft :: Windows",
25
+ "Operating System :: MacOS",
26
+ "Intended Audience :: Science/Research",
27
+ "Topic :: Scientific/Engineering",
28
+ "Topic :: Software Development",
29
+ ]
30
+
31
+ [project.urls]
32
+ Home = "https://keras.io/keras_hub/"
33
+ Repository = "https://github.com/keras-team/keras/keras_hub"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,196 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: keras-nlp-nightly
3
- Version: 0.13.0.dev2024070403
4
- Summary: Industry-strength Natural Language Processing extensions for Keras.
5
- Home-page: https://github.com/keras-team/keras-nlp
6
- Author: Keras team
7
- Author-email: keras-nlp@google.com
8
- License: Apache License 2.0
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3 :: Only
16
- Classifier: Operating System :: Unix
17
- Classifier: Operating System :: Microsoft :: Windows
18
- Classifier: Operating System :: MacOS
19
- Classifier: Intended Audience :: Science/Research
20
- Classifier: Topic :: Scientific/Engineering
21
- Classifier: Topic :: Software Development
22
- Requires-Python: >=3.9
23
- Description-Content-Type: text/markdown
24
- Requires-Dist: absl-py
25
- Requires-Dist: numpy
26
- Requires-Dist: packaging
27
- Requires-Dist: regex
28
- Requires-Dist: rich
29
- Requires-Dist: kagglehub
30
- Requires-Dist: tensorflow-text; platform_system != "Darwin"
31
- Provides-Extra: extras
32
- Requires-Dist: rouge-score; extra == "extras"
33
- Requires-Dist: sentencepiece; extra == "extras"
34
-
35
- # KerasNLP: Multi-framework NLP Models
36
- [![](https://github.com/keras-team/keras-nlp/workflows/Tests/badge.svg?branch=master)](https://github.com/keras-team/keras-nlp/actions?query=workflow%3ATests+branch%3Amaster)
37
- ![Python](https://img.shields.io/badge/python-v3.9.0+-success.svg)
38
- [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/keras-team/keras-nlp/issues)
39
-
40
- KerasNLP is a natural language processing library that works natively
41
- with TensorFlow, JAX, or PyTorch. KerasNLP provides a repository of pre-trained
42
- models and a collection of lower-level building blocks for language modeling.
43
- Built on Keras 3, models can be trained and serialized in any framework
44
- and re-used in another without costly migrations.
45
-
46
- This library is an extension of the core Keras API; all high-level modules are
47
- Layers and Models that receive that same level of polish as core Keras.
48
- If you are familiar with Keras, congratulations! You already understand most of
49
- KerasNLP.
50
-
51
- All models support JAX, TensorFlow, and PyTorch from a single model
52
- definition and can be fine-tuned on GPUs and TPUs out of the box. Models can
53
- be trained on individual accelerators with built-in PEFT techniques, or
54
- fine-tuned at scale with model and data parallel training. See our
55
- [Getting Started guide](https://keras.io/guides/keras_nlp/getting_started)
56
- to start learning our API. Browse our models on
57
- [Kaggle](https://www.kaggle.com/organizations/keras/models).
58
- We welcome contributions.
59
-
60
- ## Quick Links
61
-
62
- ### For everyone
63
-
64
- - [Home Page](https://keras.io/keras_nlp)
65
- - [Developer Guides](https://keras.io/guides/keras_nlp)
66
- - [API Reference](https://keras.io/api/keras_nlp)
67
- - [Pre-trained Models](https://www.kaggle.com/organizations/keras/models)
68
-
69
- ### For contributors
70
-
71
- - [Contributing Guide](CONTRIBUTING.md)
72
- - [Roadmap](ROADMAP.md)
73
- - [Style Guide](STYLE_GUIDE.md)
74
- - [API Design Guide](API_DESIGN_GUIDE.md)
75
- - [Call for Contributions](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22)
76
-
77
- ## Quickstart
78
-
79
- Fine-tune BERT on IMDb movie reviews:
80
-
81
- ```python
82
- import os
83
- os.environ["KERAS_BACKEND"] = "jax" # Or "tensorflow" or "torch"!
84
-
85
- import keras_nlp
86
- import tensorflow_datasets as tfds
87
-
88
- imdb_train, imdb_test = tfds.load(
89
- "imdb_reviews",
90
- split=["train", "test"],
91
- as_supervised=True,
92
- batch_size=16,
93
- )
94
- # Load a BERT model.
95
- classifier = keras_nlp.models.Classifier.from_preset(
96
- "bert_base_en",
97
- num_classes=2,
98
- activation="softmax",
99
- )
100
- # Fine-tune on IMDb movie reviews.
101
- classifier.fit(imdb_train, validation_data=imdb_test)
102
- # Predict two new examples.
103
- classifier.predict(["What an amazing movie!", "A total waste of my time."])
104
- ```
105
-
106
- Try it out [in a colab](https://colab.research.google.com/gist/mattdangerw/e457e42d5ea827110c8d5cb4eb9d9a07/kerasnlp-quickstart.ipynb).
107
- For more in depth guides and examples, visit
108
- [keras.io/keras_nlp](https://keras.io/keras_nlp/).
109
-
110
- ## Installation
111
-
112
- To install the latest KerasNLP release with Keras 3, simply run:
113
-
114
- ```
115
- pip install --upgrade keras-nlp
116
- ```
117
-
118
- To install the latest nightly changes for both KerasNLP and Keras, you can use
119
- our nightly package.
120
-
121
- ```
122
- pip install --upgrade keras-nlp-nightly
123
- ```
124
-
125
- Note that currently, installing KerasNLP will always pull in TensorFlow for use
126
- of the `tf.data` API for preprocessing. Even when pre-processing with `tf.data`,
127
- training can still happen on any backend.
128
-
129
- Read [Getting started with Keras](https://keras.io/getting_started/) for more
130
- information on installing Keras 3 and compatibility with different frameworks.
131
-
132
- > [!IMPORTANT]
133
- > We recommend using KerasNLP with TensorFlow 2.16 or later, as TF 2.16 packages
134
- > Keras 3 by default.
135
-
136
- ## Configuring your backend
137
-
138
- If you have Keras 3 installed in your environment (see installation above),
139
- you can use KerasNLP with any of JAX, TensorFlow and PyTorch. To do so, set the
140
- `KERAS_BACKEND` environment variable. For example:
141
-
142
- ```shell
143
- export KERAS_BACKEND=jax
144
- ```
145
-
146
- Or in Colab, with:
147
-
148
- ```python
149
- import os
150
- os.environ["KERAS_BACKEND"] = "jax"
151
-
152
- import keras_nlp
153
- ```
154
-
155
- > [!IMPORTANT]
156
- > Make sure to set the `KERAS_BACKEND` before import any Keras libraries, it
157
- > will be used to set up Keras when it is first imported.
158
-
159
- ## Compatibility
160
-
161
- We follow [Semantic Versioning](https://semver.org/), and plan to
162
- provide backwards compatibility guarantees both for code and saved models built
163
- with our components. While we continue with pre-release `0.y.z` development, we
164
- may break compatibility at any time and APIs should not be consider stable.
165
-
166
- ## Disclaimer
167
-
168
- KerasNLP provides access to pre-trained models via the `keras_nlp.models` API.
169
- These pre-trained models are provided on an "as is" basis, without warranties
170
- or conditions of any kind. The following underlying models are provided by third
171
- parties, and subject to separate licenses:
172
- BART, BLOOM, DeBERTa, DistilBERT, GPT-2, Llama, Mistral, OPT, RoBERTa, Whisper,
173
- and XLM-RoBERTa.
174
-
175
- ## Citing KerasNLP
176
-
177
- If KerasNLP helps your research, we appreciate your citations.
178
- Here is the BibTeX entry:
179
-
180
- ```bibtex
181
- @misc{kerasnlp2022,
182
- title={KerasNLP},
183
- author={Watson, Matthew, and Qian, Chen, and Bischof, Jonathan and Chollet,
184
- Fran\c{c}ois and others},
185
- year={2022},
186
- howpublished={\url{https://github.com/keras-team/keras-nlp}},
187
- }
188
- ```
189
-
190
- ## Acknowledgements
191
-
192
- Thank you to all of our wonderful contributors!
193
-
194
- <a href="https://github.com/keras-team/keras-nlp/graphs/contributors">
195
- <img src="https://contrib.rocks/image?repo=keras-team/keras-nlp" />
196
- </a>
@@ -1,162 +0,0 @@
1
- # KerasNLP: Multi-framework NLP Models
2
- [![](https://github.com/keras-team/keras-nlp/workflows/Tests/badge.svg?branch=master)](https://github.com/keras-team/keras-nlp/actions?query=workflow%3ATests+branch%3Amaster)
3
- ![Python](https://img.shields.io/badge/python-v3.9.0+-success.svg)
4
- [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/keras-team/keras-nlp/issues)
5
-
6
- KerasNLP is a natural language processing library that works natively
7
- with TensorFlow, JAX, or PyTorch. KerasNLP provides a repository of pre-trained
8
- models and a collection of lower-level building blocks for language modeling.
9
- Built on Keras 3, models can be trained and serialized in any framework
10
- and re-used in another without costly migrations.
11
-
12
- This library is an extension of the core Keras API; all high-level modules are
13
- Layers and Models that receive that same level of polish as core Keras.
14
- If you are familiar with Keras, congratulations! You already understand most of
15
- KerasNLP.
16
-
17
- All models support JAX, TensorFlow, and PyTorch from a single model
18
- definition and can be fine-tuned on GPUs and TPUs out of the box. Models can
19
- be trained on individual accelerators with built-in PEFT techniques, or
20
- fine-tuned at scale with model and data parallel training. See our
21
- [Getting Started guide](https://keras.io/guides/keras_nlp/getting_started)
22
- to start learning our API. Browse our models on
23
- [Kaggle](https://www.kaggle.com/organizations/keras/models).
24
- We welcome contributions.
25
-
26
- ## Quick Links
27
-
28
- ### For everyone
29
-
30
- - [Home Page](https://keras.io/keras_nlp)
31
- - [Developer Guides](https://keras.io/guides/keras_nlp)
32
- - [API Reference](https://keras.io/api/keras_nlp)
33
- - [Pre-trained Models](https://www.kaggle.com/organizations/keras/models)
34
-
35
- ### For contributors
36
-
37
- - [Contributing Guide](CONTRIBUTING.md)
38
- - [Roadmap](ROADMAP.md)
39
- - [Style Guide](STYLE_GUIDE.md)
40
- - [API Design Guide](API_DESIGN_GUIDE.md)
41
- - [Call for Contributions](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22)
42
-
43
- ## Quickstart
44
-
45
- Fine-tune BERT on IMDb movie reviews:
46
-
47
- ```python
48
- import os
49
- os.environ["KERAS_BACKEND"] = "jax" # Or "tensorflow" or "torch"!
50
-
51
- import keras_nlp
52
- import tensorflow_datasets as tfds
53
-
54
- imdb_train, imdb_test = tfds.load(
55
- "imdb_reviews",
56
- split=["train", "test"],
57
- as_supervised=True,
58
- batch_size=16,
59
- )
60
- # Load a BERT model.
61
- classifier = keras_nlp.models.Classifier.from_preset(
62
- "bert_base_en",
63
- num_classes=2,
64
- activation="softmax",
65
- )
66
- # Fine-tune on IMDb movie reviews.
67
- classifier.fit(imdb_train, validation_data=imdb_test)
68
- # Predict two new examples.
69
- classifier.predict(["What an amazing movie!", "A total waste of my time."])
70
- ```
71
-
72
- Try it out [in a colab](https://colab.research.google.com/gist/mattdangerw/e457e42d5ea827110c8d5cb4eb9d9a07/kerasnlp-quickstart.ipynb).
73
- For more in depth guides and examples, visit
74
- [keras.io/keras_nlp](https://keras.io/keras_nlp/).
75
-
76
- ## Installation
77
-
78
- To install the latest KerasNLP release with Keras 3, simply run:
79
-
80
- ```
81
- pip install --upgrade keras-nlp
82
- ```
83
-
84
- To install the latest nightly changes for both KerasNLP and Keras, you can use
85
- our nightly package.
86
-
87
- ```
88
- pip install --upgrade keras-nlp-nightly
89
- ```
90
-
91
- Note that currently, installing KerasNLP will always pull in TensorFlow for use
92
- of the `tf.data` API for preprocessing. Even when pre-processing with `tf.data`,
93
- training can still happen on any backend.
94
-
95
- Read [Getting started with Keras](https://keras.io/getting_started/) for more
96
- information on installing Keras 3 and compatibility with different frameworks.
97
-
98
- > [!IMPORTANT]
99
- > We recommend using KerasNLP with TensorFlow 2.16 or later, as TF 2.16 packages
100
- > Keras 3 by default.
101
-
102
- ## Configuring your backend
103
-
104
- If you have Keras 3 installed in your environment (see installation above),
105
- you can use KerasNLP with any of JAX, TensorFlow and PyTorch. To do so, set the
106
- `KERAS_BACKEND` environment variable. For example:
107
-
108
- ```shell
109
- export KERAS_BACKEND=jax
110
- ```
111
-
112
- Or in Colab, with:
113
-
114
- ```python
115
- import os
116
- os.environ["KERAS_BACKEND"] = "jax"
117
-
118
- import keras_nlp
119
- ```
120
-
121
- > [!IMPORTANT]
122
- > Make sure to set the `KERAS_BACKEND` before import any Keras libraries, it
123
- > will be used to set up Keras when it is first imported.
124
-
125
- ## Compatibility
126
-
127
- We follow [Semantic Versioning](https://semver.org/), and plan to
128
- provide backwards compatibility guarantees both for code and saved models built
129
- with our components. While we continue with pre-release `0.y.z` development, we
130
- may break compatibility at any time and APIs should not be consider stable.
131
-
132
- ## Disclaimer
133
-
134
- KerasNLP provides access to pre-trained models via the `keras_nlp.models` API.
135
- These pre-trained models are provided on an "as is" basis, without warranties
136
- or conditions of any kind. The following underlying models are provided by third
137
- parties, and subject to separate licenses:
138
- BART, BLOOM, DeBERTa, DistilBERT, GPT-2, Llama, Mistral, OPT, RoBERTa, Whisper,
139
- and XLM-RoBERTa.
140
-
141
- ## Citing KerasNLP
142
-
143
- If KerasNLP helps your research, we appreciate your citations.
144
- Here is the BibTeX entry:
145
-
146
- ```bibtex
147
- @misc{kerasnlp2022,
148
- title={KerasNLP},
149
- author={Watson, Matthew, and Qian, Chen, and Bischof, Jonathan and Chollet,
150
- Fran\c{c}ois and others},
151
- year={2022},
152
- howpublished={\url{https://github.com/keras-team/keras-nlp}},
153
- }
154
- ```
155
-
156
- ## Acknowledgements
157
-
158
- Thank you to all of our wonderful contributors!
159
-
160
- <a href="https://github.com/keras-team/keras-nlp/graphs/contributors">
161
- <img src="https://contrib.rocks/image?repo=keras-team/keras-nlp" />
162
- </a>
@@ -1,46 +0,0 @@
1
- # Copyright 2023 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
- """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
- import os
21
-
22
- # Import everything from /api/ into keras.
23
- from keras_nlp.api import * # noqa: F403
24
- from keras_nlp.api import __version__ # Import * ignores names start with "_".
25
-
26
- # Add everything in /api/ to the module search path.
27
- __path__.append(os.path.join(os.path.dirname(__file__), "api")) # noqa: F405
28
-
29
- # Don't pollute namespace.
30
- del os
31
-
32
-
33
- # Never autocomplete `.src` or `.api` on an imported keras object.
34
- def __dir__():
35
- keys = dict.fromkeys((globals().keys()))
36
- keys.pop("src")
37
- keys.pop("api")
38
- return list(keys)
39
-
40
-
41
- # Don't import `.src` or `.api` during `from keras import *`.
42
- __all__ = [
43
- name
44
- for name in globals().keys()
45
- if not (name.startswith("_") or name in ("src", "api"))
46
- ]
@@ -1,27 +0,0 @@
1
- # Copyright 2023 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
- """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_nlp.api import layers
21
- from keras_nlp.api import metrics
22
- from keras_nlp.api import models
23
- from keras_nlp.api import samplers
24
- from keras_nlp.api import tokenizers
25
- from keras_nlp.src.utils.preset_utils import upload_preset
26
- from keras_nlp.src.version_utils import __version__
27
- from keras_nlp.src.version_utils import version
@@ -1,47 +0,0 @@
1
- # Copyright 2023 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
- """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_nlp.src.layers.modeling.alibi_bias import AlibiBias
21
- from keras_nlp.src.layers.modeling.cached_multi_head_attention import (
22
- CachedMultiHeadAttention,
23
- )
24
- from keras_nlp.src.layers.modeling.f_net_encoder import FNetEncoder
25
- from keras_nlp.src.layers.modeling.masked_lm_head import MaskedLMHead
26
- from keras_nlp.src.layers.modeling.position_embedding import PositionEmbedding
27
- from keras_nlp.src.layers.modeling.reversible_embedding import (
28
- ReversibleEmbedding,
29
- )
30
- from keras_nlp.src.layers.modeling.rotary_embedding import RotaryEmbedding
31
- from keras_nlp.src.layers.modeling.sine_position_encoding import (
32
- SinePositionEncoding,
33
- )
34
- from keras_nlp.src.layers.modeling.token_and_position_embedding import (
35
- TokenAndPositionEmbedding,
36
- )
37
- from keras_nlp.src.layers.modeling.transformer_decoder import TransformerDecoder
38
- from keras_nlp.src.layers.modeling.transformer_encoder import TransformerEncoder
39
- from keras_nlp.src.layers.preprocessing.masked_lm_mask_generator import (
40
- MaskedLMMaskGenerator,
41
- )
42
- from keras_nlp.src.layers.preprocessing.multi_segment_packer import (
43
- MultiSegmentPacker,
44
- )
45
- from keras_nlp.src.layers.preprocessing.random_deletion import RandomDeletion
46
- from keras_nlp.src.layers.preprocessing.random_swap import RandomSwap
47
- from keras_nlp.src.layers.preprocessing.start_end_packer import StartEndPacker
@@ -1,24 +0,0 @@
1
- # Copyright 2023 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
- """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_nlp.src.metrics.bleu import Bleu
21
- from keras_nlp.src.metrics.edit_distance import EditDistance
22
- from keras_nlp.src.metrics.perplexity import Perplexity
23
- from keras_nlp.src.metrics.rouge_l import RougeL
24
- from keras_nlp.src.metrics.rouge_n import RougeN