Instructions to use ehsanhon/my-finetuned-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use ehsanhon/my-finetuned-model with KerasHub:
import keras_hub # Load CausalLM model (optional: use half precision for inference) causal_lm = keras_hub.models.CausalLM.from_preset("hf://ehsanhon/my-finetuned-model", 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://ehsanhon/my-finetuned-model") - Keras
How to use ehsanhon/my-finetuned-model 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://ehsanhon/my-finetuned-model") - Notebooks
- Google Colab
- Kaggle
Download config.json from ehsanhon/my-finetuned-model: direct link, hf CLI and curl.
- Browser
- Download file 785 Bytes
-
https://huggingface.co/ehsanhon/my-finetuned-model/resolve/main/config.json
- Command line
-
hf download hf://ehsanhon/my-finetuned-model/config.json
-
curl -L -o config.json https://huggingface.co/ehsanhon/my-finetuned-model/resolve/main/config.json
785 Bytes
| { | |
| "module": "keras_hub.src.models.gemma.gemma_backbone", | |
| "class_name": "GemmaBackbone", | |
| "config": { | |
| "name": "gemma_backbone", | |
| "trainable": true, | |
| "vocabulary_size": 256000, | |
| "num_layers": 18, | |
| "num_query_heads": 8, | |
| "num_key_value_heads": 1, | |
| "hidden_dim": 2048, | |
| "intermediate_dim": 32768, | |
| "head_dim": 256, | |
| "layer_norm_epsilon": 1e-06, | |
| "dropout": 0, | |
| "query_head_dim_normalize": true, | |
| "use_post_ffw_norm": false, | |
| "use_post_attention_norm": false, | |
| "final_logit_soft_cap": null, | |
| "attention_logit_soft_cap": null, | |
| "sliding_window_size": 4096, | |
| "use_sliding_window_attention": false | |
| }, | |
| "registered_name": "keras_hub>GemmaBackbone" | |
| } |