Instructions to use rodrigomt/gama-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rodrigomt/gama-12b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rodrigomt/gama-12b") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("rodrigomt/gama-12b") model = AutoModelForImageTextToText.from_pretrained("rodrigomt/gama-12b") 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
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rodrigomt/gama-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rodrigomt/gama-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rodrigomt/gama-12b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rodrigomt/gama-12b
- SGLang
How to use rodrigomt/gama-12b 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 "rodrigomt/gama-12b" \ --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": "rodrigomt/gama-12b", "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 "rodrigomt/gama-12b" \ --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": "rodrigomt/gama-12b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rodrigomt/gama-12b with Docker Model Runner:
docker model run hf.co/rodrigomt/gama-12b
🤖 gama-12b
gama-12b is a 12-billion parameter language model created through the strategic merge of multiple specialized models. This model combines the capabilities of different architectures to offer a more robust and versatile conversational experience.
📋 Overview
This model was developed using the DARE TIES (Drop And REscale with Ties-Elimination) technique, an advanced model merging methodology that allows for the efficient combination of different specializations into a single cohesive model.
🔧 Base Models Used
gama-12b is the result of merging the following models:
🛠️ Merge Tool
The merge was performed using LazyMergekit, a tool that facilitates the process of merging language models.
⚙️ Technical Configuration
Merge Parameters
models:
- model: soob3123/amoral-gemma3-12B-v2-qat
parameters:
density: 0.6
weight: 0.33
- model: allura-org/Gemma-3-Glitter-12B
parameters:
density: 0.6
weight: 0.33
- model: soob3123/Veiled-Calla-12B
parameters:
density: 0.6
weight: 0.34
merge_method: dare_ties
base_model: unsloth/gemma-3-12b-it-qat
parameters:
normalize: true
int8_mask: true
device: auto
dtype: float16
Technical Specifications
- Architecture: Gemma-3 12B
- Merge Method: DARE TIES
- Precision: Float16
- Quantization: QAT (Quantization Aware Training)
- Normalization: Enabled
- Int8 Mask: Enabled
💻 How to Use
Installing Dependencies
pip install -qU transformers accelerate torch
Basic Usage Example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
# Model configuration
model_name = "rodrigomt/gama-12b"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# Prepare the message
messages = [
{"role": "user", "content": "What is a large language model?"}
]
# Apply chat template
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
# Pipeline configuration
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.float16,
device_map="auto",
)
# Text generation
outputs = pipeline(
prompt,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_k=50,
top_p=0.95,
repetition_penalty=1.1
)
print(outputs[0]["generated_text"])
Advanced Usage Example
# For more granular control
inputs = tokenizer.encode(prompt, return_tensors="pt")
attention_mask = inputs.ne(tokenizer.pad_token_id)
with torch.no_grad():
outputs = model.generate(
inputs,
attention_mask=attention_mask,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_k=50,
top_p=0.95,
repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
🎯 Key Features
- Versatility: Combines capabilities from multiple specialized models
- Efficiency: Optimized with QAT quantization for better performance
- Compatibility: Fully compatible with the Transformers library
- Scalability: Supports deployment on different hardware configurations
⚠️ System Requirements
Recommended Minimums
- RAM: 32GB
- VRAM: 24GB (GPU)
- Storage: 50GB available
Ideal Configuration
- RAM: 64GB+
- VRAM: 40GB+ (GPU)
- GPU: A6000, A100, or higher
📝 License
This model is licensed under the Gemma License.
- Downloads last month
- 12