Instructions to use Samarth16k/gemma3-finetuned-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use Samarth16k/gemma3-finetuned-hf with KerasHub:
import keras_hub # Load CausalLM model (optional: use half precision for inference) causal_lm = keras_hub.models.CausalLM.from_preset("hf://Samarth16k/gemma3-finetuned-hf", 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 TextEmbedder model task = keras_hub.models.TextEmbedder.from_preset("hf://Samarth16k/gemma3-finetuned-hf")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://Samarth16k/gemma3-finetuned-hf") - Keras
How to use Samarth16k/gemma3-finetuned-hf with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Samarth16k/gemma3-finetuned-hf") - Notebooks
- Google Colab
- Kaggle
This is a Gemma3 model uploaded using the KerasHub library and can be used with JAX, TensorFlow, and PyTorch backends.
This model is related to a CausalLM task.
Model config:
- name: gemma3_backbone
- trainable: True
- dtype: {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}
- vocabulary_size: 262144
- image_size: 896
- num_layers: 34
- num_query_heads: 8
- num_key_value_heads: 4
- hidden_dim: 2560
- intermediate_dim: 10240
- head_dim: 256
- query_head_dim_normalize: True
- use_query_key_norm: True
- use_post_ffw_norm: True
- use_post_attention_norm: True
- attention_logit_soft_cap: None
- final_logit_soft_cap: None
- use_sliding_window_attention: True
- sliding_window_size: 1024
- local_rope_scaling_factor: 1.0
- global_rope_scaling_factor: 8.0
- vision_encoder: {'module': 'keras_hub.src.models.gemma3.gemma3_vision_encoder', 'class_name': 'Gemma3VisionEncoder', 'config': {'name': 'gemma3_vision_encoder', 'trainable': False, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}, 'num_heads': 16, 'hidden_dim': 1152, 'num_layers': 27, 'intermediate_dim': 4304, 'output_dim': 2560, 'pool_size': 4, 'image_size': 896, 'patch_size': 14, 'layer_norm_epsilon': 1e-06}, 'registered_name': 'keras_hub>Gemma3VisionEncoder'}
- use_bidirectional_attention: False
- layer_norm_epsilon: 1e-06
- dropout: 0
- is_embedding_model: False
- pooling_intermediate_dim: None
- embedding_dim: None
This model card has been generated automatically and should be completed by the model author. See Model Cards documentation for more information.
- Downloads last month
- 79