Instructions to use keras/bloomz_1.1b_multi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/bloomz_1.1b_multi with KerasHub:
import keras_hub # Load CausalLM model (optional: use half precision for inference) causal_lm = keras_hub.models.CausalLM.from_preset("hf://keras/bloomz_1.1b_multi", dtype="bfloat16") causal_lm.compile(sampler="greedy") # (optional) specify a sampler # Generate text causal_lm.generate("Keras: deep learning for", max_length=64)import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/bloomz_1.1b_multi") - Keras
How to use keras/bloomz_1.1b_multi with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://keras/bloomz_1.1b_multi") - Notebooks
- Google Colab
- Kaggle
Download tokenizer.json from keras/bloomz_1.1b_multi: direct link, hf CLI and curl.
- Browser
- Download file 654 Bytes
-
https://huggingface.co/keras/bloomz_1.1b_multi/resolve/main/tokenizer.json
- Command line
-
hf download hf://keras/bloomz_1.1b_multi/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/keras/bloomz_1.1b_multi/resolve/main/tokenizer.json
654 Bytes
| { | |
| "module": "keras_hub.src.models.bloom.bloom_tokenizer", | |
| "class_name": "BloomTokenizer", | |
| "config": { | |
| "name": "bloom_tokenizer", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "int32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "config_file": "tokenizer.json", | |
| "sequence_length": null, | |
| "add_prefix_space": false, | |
| "unsplittable_tokens": [ | |
| "</s>", | |
| "<pad>", | |
| "<s>" | |
| ] | |
| }, | |
| "registered_name": "keras_hub>BloomTokenizer" | |
| } |