Views
No views yet
google/gemma-4-E2B-it. It is specialised
for natural, fluent Malayalam conversation and instruction following.transformers text-generation model; use the chat
template as usual.1from transformers import AutoModelForImageTextToText, AutoTokenizer
2import torch
3
4model_id = "Navneeth017/Malayalam_gemma-4-E2B-it"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForImageTextToText.from_pretrained(
7 model_id, dtype=torch.bfloat16, device_map="auto"
8)
9
10messages = [
11 {"role": "system", "content": "നിങ്ങൾ സഹായകരമായ ഒരു മലയാളം സഹായിയാണ്."},
12 {"role": "user", "content": "കേരളത്തിലെ ഓണം ആഘോഷത്തെക്കുറിച്ച് വിശദീകരിക്കൂ."},
13]
14inputs = tokenizer.apply_chat_template(
15 messages, add_generation_prompt=True, return_tensors="pt"
16).to(model.device)
17
18out = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9)
19print(tokenizer.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))google/gemma-4-E2B-it. See the
Gemma 4 license terms.