Instructions to use keras/llama2_7b_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/llama2_7b_en with KerasHub:
import keras_hub # Load CausalLM model (optional: use half precision for inference) causal_lm = keras_hub.models.CausalLM.from_preset("hf://keras/llama2_7b_en", 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/llama2_7b_en") - Keras
How to use keras/llama2_7b_en 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/llama2_7b_en") - Notebooks
- Google Colab
- Kaggle
Commit History
-
Upload folder using huggingface_hub
Verified signature433a14c
-
Update README.md with new model card content
Verified signature5f3df1c
-
Upload folder using huggingface_hub
Verified signature65e59e8
-
Update README.md with new model card content
Verified signaturead6c309
-
Update README.md
Verified signature7e50176
-
Update README.md
Verified signature7a4724c
-
Update README.md with new model card content
Verified signaturec4052a4
-
Update README.md with new model card content
Verified signaturef212b73 -
Update README.md with new model card content
Verified signature2e11e09 -
Update README.md with new model card content
Verified signaturef4202dc -
Update README.md with new model card content
Verified signaturedaae920 -
Update README.md with new model card content
Verified signature7f38a17
-
Upload folder using huggingface_hub
Verified signaturebe78497 -
initial commit
Verified signature7d4e0fd