๐Ÿ‡ฎ๐Ÿ‡ณ Gemma-4-E4B-Hindi-Instruct (16-bit)

A Hindi instruction-tuned fine-tune of Gemma 4 E4B. This is the merged 16-bit model for use with ๐Ÿค— Transformers / vLLM / further fine-tuning.

For local CPU/edge use, see the GGUF build.

Part of my Hindi LLM Series โ€” small, openly-documented Indic models that actually follow instructions in Hindi and run on your own machine.


Usage (Transformers)

from transformers import AutoModelForCausalLM, AutoProcessor
import torch

model_id = "pankajpandey-dev/gemma-4-e4b-hindi-instruct"
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
proc  = AutoProcessor.from_pretrained(model_id)

msgs = [{"role": "user", "content": [{"type": "text", "text": "เคฎเคถเฅ€เคจ เคฒเคฐเฅเคจเคฟเค‚เค— เค•เฅ‹ เค†เคธเคพเคจ เคถเคฌเฅเคฆเฅ‹เค‚ เคฎเฅ‡เค‚ เคธเคฎเคเคพเค“เฅค"}]}]
inputs = proc.apply_chat_template(msgs, add_generation_prompt=True, tokenize=True,
                                  return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, use_cache=True)
print(proc.decode(out[0], skip_special_tokens=True))

Example outputs

Prompt: เคญเคพเคฐเคค เค•เฅ‡ เคฌเคพเคฐเฅ‡ เคฎเฅ‡เค‚ เคเค• เคฐเฅ‹เคšเค• เคคเคฅเฅเคฏ เคฌเคคเคพเค“เฅค

เคญเคพเคฐเคค เคฆเฅเคจเคฟเคฏเคพ เคฎเฅ‡เค‚ เคธเคฌเคธเฅ‡ เค…เคงเคฟเค• เคญเคพเคทเคพเค“เค‚ เคตเคพเคฒเฅ‡ เคฆเฅ‡เคถเฅ‹เค‚ เคฎเฅ‡เค‚ เคธเฅ‡ เคเค• เคนเฅˆ โ€” 22 เค†เคงเคฟเค•เคพเคฐเคฟเค• เคญเคพเคทเคพเคเค เค”เคฐ 1,000 เคธเฅ‡ เค…เคงเคฟเค• เคฌเฅ‹เคฒเคฟเคฏเคพเคเฅค เคนเคฟเค‚เคฆเฅ€ เคเค• เค‡เค‚เคกเฅ‹-เค†เคฐเฅเคฏเคจ เคญเคพเคทเคพ เคนเฅˆ, เคœเคฌเค•เคฟ เคคเคฎเคฟเคฒ เคเค• เคฆเฅเคฐเคตเคฟเคกเคผ เคญเคพเคทเคพ เคนเฅˆเฅค


Training details

Base model unsloth/gemma-4-E4B-it
Method LoRA (r=16, ฮฑ=16), response-only loss
Framework Unsloth
Data ~10k Hindi instruction pairs (AI4Bharat indic-instruct: anudesh + dolly, hi splits)
Epochs 2
LR / schedule 1e-4, cosine
Precision bf16 (4-bit QLoRA base)
Hardware Single NVIDIA L4 (24 GB)
Final train loss ~0.29

Trained text-only (vision layers frozen), single-BOS chat template to avoid double-BOS corruption.


Related repos


Provenance & license (please read)

Mixed-license lineage โ€” review all before redistribution or commercial use:

Raw training data is not redistributed here. You are responsible for complying with the Gemma, Llama 2, and CC-BY-SA terms.


Limitations

  • ~8B-class model: strong Hindi fluency, but can hallucinate facts and occasionally repeat phrasing on long open-ended generation.
  • Tuned for single-turn Hindi instructions; long multi-turn chat is not the focus.
  • Not safety-aligned for production.

Acknowledgements

Base model by Google (Gemma 4). Data by AI4Bharat. Fine-tuning with Unsloth. ๐Ÿ™

Downloads last month
32
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for pankajpandey-dev/gemma-4-e4b-hindi-instruct

Finetuned
(124)
this model

Dataset used to train pankajpandey-dev/gemma-4-e4b-hindi-instruct

Collection including pankajpandey-dev/gemma-4-e4b-hindi-instruct

Article mentioning pankajpandey-dev/gemma-4-e4b-hindi-instruct