Modular Natural Language Processing workflows with Keras
APACHE-2.0 License
Bot releases are visible (Hide)
Published by mattdangerw 30 days ago
Bug fix patch release.
XXClasssifier
as XXTextClassifier
.Full Changelog: https://github.com/keras-team/keras-hub/compare/v0.15.0...v0.15.1
Published by mattdangerw about 1 month ago
📢 KerasNLP is becoming KerasHub 📢, read more about it here.
This release contains a number of feature improvements:
quantize()
method to quantize any model.from_preset()
on a base class, and we will find the correct subclass to create.Classifier
as TextClassifier
, BertClassifier
as BertTextClassifier
.tokenizer.special_tokens
and tokenizer.special_token_ids
as convenient properties to view all special tokens on a pretrained tokenizer.# Quantize an unquantized model.
lm = keras_nlp.models.CausalLM.from_preset(
"gemma2_instruct_2b_en",
dtype="bfloat16",
)
lm.quantize("int8")
# Load a pre-quantized model.
lm = keras_nlp.models.CausalLM.from_preset(
"llama3_instruct_8b_en_int8",
dtype="bfloat16",
)
# Convert a bert model in the huggingface/transformers format.
classifier = keras_nlp.models.TextClassifier.from_preset(
"hf://google-bert/bert-base-uncased",
num_classes=2,
)
# View all special tokens.
print(classifier.preprocessor.tokenizer.special_tokens)
print(classifier.preprocessor.tokenizer.special_token_ids)
tokenize()
and detokenize()
.tf.Tensor
output on the tensorflow
backend, but will lead to consistent output on all backends, which we believe will be an overall improvement.tf.data
preprocessing pipeline, on any backend.Gemma
, Gemma2
and PaliGemma
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1670
run_quantization_check
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1682
ReversibleEmbedding
and LayerNorm
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1692
XLNet
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1699
to_numpy=True
in quantize
if available by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1725
kwargs
to Backbone.from_preset
and fix the dtype forwarding in Task.from_preset
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1742
add_bos=False, add_eos=False
to SentencePieceTokenizer.init() by @briango28 in https://github.com/keras-team/keras-nlp/pull/1811
load_task_extras
is passed by @mattdangerw in https://github.com/keras-team/keras-nlp/pull/1812
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.14.4...v0.15.0
Published by mattdangerw 2 months ago
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.14.3...v0.14.4
Published by mattdangerw 3 months ago
keras_nlp.models.GemmaCausalLM.from_preset("shieldgemma_2b_en")
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.14.2...v0.14.3
Published by mattdangerw 3 months ago
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.14.1...v0.14.2
Published by mattdangerw 3 months ago
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.14.0...v0.14.1
Published by grasskin 4 months ago
safetensor
checkpoint from Hugging Face hub by @ariG23498 in https://github.com/keras-team/keras-nlp/pull/1662
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.12.1...r0.14
[0, 255]
range. This is a backward incompatible change with the original release. Restore the original behavior as follows:keras_nlp.models.PaliGemmaBackbone.from_preset(
"pali_gemma_3b_224",
include_rescaling=False,
)
FalconCausalLM
by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1635
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.12.0...v0.12.1
Published by divyashreepathihalli 5 months ago
Add PaliGemma, Llama 3, and Phi 3 models.
PaliGemma quickstart, see a complete usage on Kaggle.
pali_gemma_lm = keras_nlp.models.PaliGemmaCausalLM.from_preset(
"pali_gemma_3b_224"
)
pali_gemma_lm.generate(
inputs={
"images": images,
"prompts": prompts,
}
)
training
argument in subclasses by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1623
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.11.1...v0.12.0
Published by grasskin 6 months ago
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.11.0...v0.11.1
Published by mattdangerw 6 months ago
This release has no major feature updates, but changes the location our source code is help. Source code is split into a src/
and api/
directory with an explicit API surface similar to core Keras.
When adding or removing new API in a PR, use ./shell/api_gen.sh
to update the autogenerated api/
files. See our contributing guide.
keras
by @james77777778 in https://github.com/keras-team/keras-nlp/pull/1596
bert_tiny_en_uncased_sst2
classifier version by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1602
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.10.0...v0.11.0
Published by SamanehSaadat 6 months ago
Task
(CausalLM
and Classifier
) saving and loading which allows uploading Task
s.positions
array in our RotaryEmbedding
layer.keras_nlp.layers.RotaryEmbedding
layer by @tirthasheshpatel in https://github.com/keras-team/keras-nlp/pull/1571
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.3...v0.10.0
Published by SamanehSaadat 6 months ago
Task
(CausalLM
and Classifier
) saving and loading which allows uploading Task
s.positions
array in our RotaryEmbedding layer.keras_nlp.layers.RotaryEmbedding
layer by @tirthasheshpatel in https://github.com/keras-team/keras-nlp/pull/1571
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.3...v0.10.0.dev2
Published by SamanehSaadat 6 months ago
Task
(CausalLM
and Classifier
) saving and loading which allows uploading Task
s.positions
array in our RotaryEmbedding layer.keras_nlp.layers.RotaryEmbedding
layer by @tirthasheshpatel in https://github.com/keras-team/keras-nlp/pull/1571
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.3...v0.10.0.dev1
Published by SamanehSaadat 6 months ago
Task
(CausalLM
and Classifier
) saving and loading which allows uploading Task
s.positions
array in our RotaryEmbedding layer.keras_nlp.layers.RotaryEmbedding
layer by @tirthasheshpatel in https://github.com/keras-team/keras-nlp/pull/1571
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.3...v0.10.0.dev0
Published by mattdangerw 6 months ago
Patch release with fixes for Llama and Mistral saving.
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.2...v0.9.3
Published by mattdangerw 6 months ago
print_fn
issue in task test by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1563
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.1...v0.9.2
Published by mattdangerw 6 months ago
🚧🚧Pre-release🚧🚧
print_fn
issue in task test by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1563
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.1...v0.9.2.dev0
Published by mattdangerw 7 months ago
Patch fix for bug with stop_token_ids
.
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.9.0...v0.9.1
Published by mattdangerw 7 months ago
The 0.9.0 release adds new models, hub integrations, and general usability improvements.
from_preset()
on base classes.
keras_nlp.models.Backbone
keras_nlp.models.Task
keras_nlp.models.Classifier
keras_nlp.models.CausalLM
keras_nlp.models.Seq2SeqLM
keras_nlp.models.MaskedLM
backbone.save_to_preset
, tokenizer.save_to_preset
, keras_nlp.upload_preset
.from_preset
and upload_preset
now work with the Hugging Face Models Hub.# Llama 2. Needs Kaggle consent and login, see https://github.com/Kaggle/kagglehub
causal_lm = keras_nlp.models.LlamaCausalLM.from_preset(
"llama2_7b_en",
dtype="bfloat16", # Run at half precision for inference.
)
causal_lm.generate("Keras is a", max_length=128)
# Base class usage.
keras_nlp.models.Classifier.from_preset("bert_base_en", num_classes=2)
keras_nlp.models.Tokenizer.from_preset("gemma_2b_en")
keras_nlp.models.CausalLM.from_preset("gpt2_base_en", dtype="mixed_bfloat16")
FalconBackbone
by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1475
FalconTokenizer
by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1485
FalconPreprocessor
by @SamanehSaadat in https://github.com/keras-team/keras-nlp/pull/1498
LlamaPreprocessor
and LlamaCausalLMPreprocessor
by @tirthasheshpatel in https://github.com/keras-team/keras-nlp/pull/1511
mistral_base_en
-> mistral_7b_en
by @asmith26 in https://github.com/keras-team/keras-nlp/pull/1528
Full Changelog: https://github.com/keras-team/keras-nlp/compare/v0.8.2...v0.9.0