Instructions to use keras/llama3.1_instruct_8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/llama3.1_instruct_8b with KerasHub:
import keras_hub # Create a LlamaCausalLM model task = keras_hub.models.LlamaCausalLM.from_preset("hf://keras/llama3.1_instruct_8b")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/llama3.1_instruct_8b") - Keras
How to use keras/llama3.1_instruct_8b with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://keras/llama3.1_instruct_8b") - Notebooks
- Google Colab
- Kaggle
| { | |
| "module": "keras_hub.src.models.llama3.llama3_causal_lm_preprocessor", | |
| "class_name": "Llama3CausalLMPreprocessor", | |
| "config": { | |
| "name": "llama3_causal_lm_preprocessor_1", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "float32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "tokenizer": { | |
| "module": "keras_hub.src.models.llama3.llama3_tokenizer", | |
| "class_name": "Llama3Tokenizer", | |
| "config": { | |
| "name": "llama3_tokenizer_1", | |
| "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": [ | |
| "<|end_of_text|>", | |
| "<|finetune_right_pad_id|>", | |
| "<|eot_id|>", | |
| "<|begin_of_text|>", | |
| "<|eom_id|>", | |
| "<|python_tag|>", | |
| "<|start_header_id|>", | |
| "<|end_header_id|>" | |
| ] | |
| }, | |
| "registered_name": "keras_hub>Llama3Tokenizer" | |
| }, | |
| "config_file": "preprocessor.json", | |
| "sequence_length": 1024, | |
| "add_start_token": true, | |
| "add_end_token": true | |
| }, | |
| "registered_name": "keras_hub>Llama3CausalLMPreprocessor" | |
| } |