Text Generation
Transformers
Safetensors
gemma3
image-text-to-text
conversational
text-generation-inference
Instructions to use aisingapore/Gemma-SEA-LION-v4-27B-IT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aisingapore/Gemma-SEA-LION-v4-27B-IT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("aisingapore/Gemma-SEA-LION-v4-27B-IT") model = AutoModelForMultimodalLM.from_pretrained("aisingapore/Gemma-SEA-LION-v4-27B-IT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aisingapore/Gemma-SEA-LION-v4-27B-IT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aisingapore/Gemma-SEA-LION-v4-27B-IT
- SGLang
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "aisingapore/Gemma-SEA-LION-v4-27B-IT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "aisingapore/Gemma-SEA-LION-v4-27B-IT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with Docker Model Runner:
docker model run hf.co/aisingapore/Gemma-SEA-LION-v4-27B-IT
Update config.json
Browse files- config.json +3 -83
config.json
CHANGED
|
@@ -13,111 +13,31 @@
|
|
| 13 |
"mm_tokens_per_image": 256,
|
| 14 |
"model_type": "gemma3",
|
| 15 |
"text_config": {
|
| 16 |
-
"_sliding_window_pattern": 6,
|
| 17 |
-
"attention_bias": false,
|
| 18 |
-
"attention_dropout": 0.0,
|
| 19 |
-
"attn_logit_softcapping": null,
|
| 20 |
-
"final_logit_softcapping": null,
|
| 21 |
"head_dim": 128,
|
| 22 |
-
"hidden_activation": "gelu_pytorch_tanh",
|
| 23 |
"hidden_size": 5376,
|
| 24 |
-
"initializer_range": 0.02,
|
| 25 |
"intermediate_size": 21504,
|
| 26 |
-
"layer_types": [
|
| 27 |
-
"sliding_attention",
|
| 28 |
-
"sliding_attention",
|
| 29 |
-
"sliding_attention",
|
| 30 |
-
"sliding_attention",
|
| 31 |
-
"sliding_attention",
|
| 32 |
-
"full_attention",
|
| 33 |
-
"sliding_attention",
|
| 34 |
-
"sliding_attention",
|
| 35 |
-
"sliding_attention",
|
| 36 |
-
"sliding_attention",
|
| 37 |
-
"sliding_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"sliding_attention",
|
| 40 |
-
"sliding_attention",
|
| 41 |
-
"sliding_attention",
|
| 42 |
-
"sliding_attention",
|
| 43 |
-
"sliding_attention",
|
| 44 |
-
"full_attention",
|
| 45 |
-
"sliding_attention",
|
| 46 |
-
"sliding_attention",
|
| 47 |
-
"sliding_attention",
|
| 48 |
-
"sliding_attention",
|
| 49 |
-
"sliding_attention",
|
| 50 |
-
"full_attention",
|
| 51 |
-
"sliding_attention",
|
| 52 |
-
"sliding_attention",
|
| 53 |
-
"sliding_attention",
|
| 54 |
-
"sliding_attention",
|
| 55 |
-
"sliding_attention",
|
| 56 |
-
"full_attention",
|
| 57 |
-
"sliding_attention",
|
| 58 |
-
"sliding_attention",
|
| 59 |
-
"sliding_attention",
|
| 60 |
-
"sliding_attention",
|
| 61 |
-
"sliding_attention",
|
| 62 |
-
"full_attention",
|
| 63 |
-
"sliding_attention",
|
| 64 |
-
"sliding_attention",
|
| 65 |
-
"sliding_attention",
|
| 66 |
-
"sliding_attention",
|
| 67 |
-
"sliding_attention",
|
| 68 |
-
"full_attention",
|
| 69 |
-
"sliding_attention",
|
| 70 |
-
"sliding_attention",
|
| 71 |
-
"sliding_attention",
|
| 72 |
-
"sliding_attention",
|
| 73 |
-
"sliding_attention",
|
| 74 |
-
"full_attention",
|
| 75 |
-
"sliding_attention",
|
| 76 |
-
"sliding_attention",
|
| 77 |
-
"sliding_attention",
|
| 78 |
-
"sliding_attention",
|
| 79 |
-
"sliding_attention",
|
| 80 |
-
"full_attention",
|
| 81 |
-
"sliding_attention",
|
| 82 |
-
"sliding_attention",
|
| 83 |
-
"sliding_attention",
|
| 84 |
-
"sliding_attention",
|
| 85 |
-
"sliding_attention",
|
| 86 |
-
"full_attention",
|
| 87 |
-
"sliding_attention",
|
| 88 |
-
"sliding_attention"
|
| 89 |
-
],
|
| 90 |
-
"max_position_embeddings": 131072,
|
| 91 |
"model_type": "gemma3_text",
|
| 92 |
"num_attention_heads": 32,
|
| 93 |
"num_hidden_layers": 62,
|
| 94 |
"num_key_value_heads": 16,
|
| 95 |
"query_pre_attn_scalar": 168,
|
| 96 |
-
"rms_norm_eps": 1e-06,
|
| 97 |
-
"rope_local_base_freq": 10000.0,
|
| 98 |
"rope_scaling": {
|
| 99 |
"factor": 8.0,
|
| 100 |
"rope_type": "linear"
|
| 101 |
},
|
| 102 |
-
"
|
| 103 |
-
"sliding_window": 1024,
|
| 104 |
-
"use_cache": true,
|
| 105 |
-
"vocab_size": 262208
|
| 106 |
},
|
| 107 |
"torch_dtype": "bfloat16",
|
| 108 |
-
"transformers_version": "4.
|
| 109 |
"vision_config": {
|
| 110 |
-
"attention_dropout": 0.0,
|
| 111 |
-
"hidden_act": "gelu_pytorch_tanh",
|
| 112 |
"hidden_size": 1152,
|
| 113 |
"image_size": 896,
|
| 114 |
"intermediate_size": 4304,
|
| 115 |
-
"layer_norm_eps": 1e-06,
|
| 116 |
"model_type": "siglip_vision_model",
|
| 117 |
"num_attention_heads": 16,
|
| 118 |
-
"num_channels": 3,
|
| 119 |
"num_hidden_layers": 27,
|
| 120 |
"patch_size": 14,
|
| 121 |
"vision_use_head": false
|
| 122 |
}
|
| 123 |
}
|
|
|
|
|
|
| 13 |
"mm_tokens_per_image": 256,
|
| 14 |
"model_type": "gemma3",
|
| 15 |
"text_config": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
"head_dim": 128,
|
|
|
|
| 17 |
"hidden_size": 5376,
|
|
|
|
| 18 |
"intermediate_size": 21504,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
"model_type": "gemma3_text",
|
| 20 |
"num_attention_heads": 32,
|
| 21 |
"num_hidden_layers": 62,
|
| 22 |
"num_key_value_heads": 16,
|
| 23 |
"query_pre_attn_scalar": 168,
|
|
|
|
|
|
|
| 24 |
"rope_scaling": {
|
| 25 |
"factor": 8.0,
|
| 26 |
"rope_type": "linear"
|
| 27 |
},
|
| 28 |
+
"sliding_window": 1024
|
|
|
|
|
|
|
|
|
|
| 29 |
},
|
| 30 |
"torch_dtype": "bfloat16",
|
| 31 |
+
"transformers_version": "4.50.0.dev0",
|
| 32 |
"vision_config": {
|
|
|
|
|
|
|
| 33 |
"hidden_size": 1152,
|
| 34 |
"image_size": 896,
|
| 35 |
"intermediate_size": 4304,
|
|
|
|
| 36 |
"model_type": "siglip_vision_model",
|
| 37 |
"num_attention_heads": 16,
|
|
|
|
| 38 |
"num_hidden_layers": 27,
|
| 39 |
"patch_size": 14,
|
| 40 |
"vision_use_head": false
|
| 41 |
}
|
| 42 |
}
|
| 43 |
+
|