Views
No views yet
sarvamai/sarvam-1
(2B) that performs Grapheme-to-Phoneme (G2P) on normalized code-mixed
Hindi/English text, emitting IPA. It is distilled from
espeak-ng: a single LLM thus does
both text-normalization (see the companion
TN adapter)
and phonemization — a unified TTS front-end.1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4tok = AutoTokenizer.from_pretrained("sarvamai/sarvam-1")
5m = AutoModelForCausalLM.from_pretrained("sarvamai/sarvam-1")
6m = PeftModel.from_pretrained(m, "AK04-IXR/sarvam1-hinglish-g2p-lora")
7
8prompt = "Input: Mera flight ticket pee-en-aar eight three nine two hai.\nOutput:"
9ids = tok(prompt, return_tensors="pt").to(m.device)
10out = m.generate(**ids, max_new_tokens=160, do_sample=False)
11print(tok.decode(out[0][ids['input_ids'].shape[1]:], skip_special_tokens=True))