Views
No views yet
| Model | #Total Params | #Active Params | Context Length | Specialization |
|---|---|---|---|---|
| SarvaCode-16B | 16B | 3.2B | 128k | India Stack & Fintech |
trust_remote_code=True to load the specialized MoE configuration.1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_path = "./SarvaCode" # Your local directory
5tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
7
8# Example: Indian Financial Logic
9input_text = "User: Write a Python function to calculate the GST for a service with an 18% slab, ensuring the output separates CGST and SGST.\n\nAssistant:"
10
11inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
12outputs = model.generate(**inputs, max_new_tokens=256)
13print(tokenizer.decode(outputs[0], skip_special_tokens=True))