Instructions to use keras/llama2_instruct_7b_en_int8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/llama2_instruct_7b_en_int8 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_instruct_7b_en_int8", 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_instruct_7b_en_int8") - Keras
How to use keras/llama2_instruct_7b_en_int8 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_instruct_7b_en_int8") - Notebooks
- Google Colab
- Kaggle
Update README.md with new model card content
Browse files
README.md
CHANGED
|
@@ -15,7 +15,7 @@ Weights are released under the [Llama 2 Community License](https://ai.meta.com/l
|
|
| 15 |
|
| 16 |
## Links
|
| 17 |
|
| 18 |
-
* [Llama 2 Quickstart Notebook](https://www.kaggle.com/code/
|
| 19 |
* [Llama 2 API Documentation](https://keras.io/api/keras_hub/models/llama2/)
|
| 20 |
* [Llama 2 Model Card & Prompt Formats](https://llama.meta.com/docs/model-cards-and-prompt-formats/other-models/)
|
| 21 |
* [KerasHub Beginner Guide](https://keras.io/guides/keras_hub/getting_started/)
|
|
@@ -27,7 +27,7 @@ Keras and KerasHub can be installed with:
|
|
| 27 |
|
| 28 |
```
|
| 29 |
pip install -U -q keras-hub
|
| 30 |
-
pip install -U -q keras
|
| 31 |
```
|
| 32 |
|
| 33 |
Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page.
|
|
|
|
| 15 |
|
| 16 |
## Links
|
| 17 |
|
| 18 |
+
* [Llama 2 Quickstart Notebook](https://www.kaggle.com/code/laxmareddypatlolla/llama2-quickstart-notebook)
|
| 19 |
* [Llama 2 API Documentation](https://keras.io/api/keras_hub/models/llama2/)
|
| 20 |
* [Llama 2 Model Card & Prompt Formats](https://llama.meta.com/docs/model-cards-and-prompt-formats/other-models/)
|
| 21 |
* [KerasHub Beginner Guide](https://keras.io/guides/keras_hub/getting_started/)
|
|
|
|
| 27 |
|
| 28 |
```
|
| 29 |
pip install -U -q keras-hub
|
| 30 |
+
pip install -U -q keras
|
| 31 |
```
|
| 32 |
|
| 33 |
Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page.
|