InaVerdict Gemma v2

InaVerdict Gemma v2 is a fine-tuned Gemma 4 E2B instruction model for Indonesian legal research and judgment analysis.

Usage

Use a recent version of Transformers with Gemma 4 support.

import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor

model_id = "Legal-verse/InaVerdict-gemma-v2"

processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "text",
                "text": "Jelaskan perbedaan ratio decidendi dan obiter dictum.",
            }
        ],
    }
]

inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)

input_length = inputs["input_ids"].shape[-1]
with torch.inference_mode():
    output_ids = model.generate(**inputs, max_new_tokens=256)

print(
    processor.tokenizer.decode(
        output_ids[0, input_length:],
        skip_special_tokens=True,
    )
)

Hosted demo and API

A ZeroGPU playground and Gradio API are available at Haeryz/inaverdict-gemma-v2-api.

Intended use

This model is intended to assist with Indonesian legal research, document analysis, and drafting. Its output is not legal advice. Verify citations, quotations, and conclusions against primary legal sources.

Downloads last month
94
Safetensors
Model size
5B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Legal-verse/InaVerdict-gemma-v2

Finetuned
(383)
this model

Spaces using Legal-verse/InaVerdict-gemma-v2 3