Text Generation
Transformers
Safetensors
Hindi
English
qwen2
hinglish
qwen
qwen2.5
sft
lora
axeai
conversational
text-generation-inference
Instructions to use iamanishx/axeai_m_0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iamanishx/axeai_m_0.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iamanishx/axeai_m_0.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iamanishx/axeai_m_0.2") model = AutoModelForCausalLM.from_pretrained("iamanishx/axeai_m_0.2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use iamanishx/axeai_m_0.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iamanishx/axeai_m_0.2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamanishx/axeai_m_0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/iamanishx/axeai_m_0.2
- SGLang
How to use iamanishx/axeai_m_0.2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "iamanishx/axeai_m_0.2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamanishx/axeai_m_0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "iamanishx/axeai_m_0.2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamanishx/axeai_m_0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use iamanishx/axeai_m_0.2 with Docker Model Runner:
docker model run hf.co/iamanishx/axeai_m_0.2
axeai_m_0.2
axeai_m_0.2 is a lightweight, conversational language model fine-tuned for high-quality Hinglish (Hindi in Roman/Latin script) interactions and coding assistance. It is built on top of iamanishx/axeai_m_0.1 (Qwen2.5-0.5B architecture) and fully merged into standalone weights.
Model Details
- Model Name: axeai_m_0.2
- Developer: Manish Biswal (@iamanishx)
- Base Architecture: Qwen2.5-0.5B
- Base Checkpoint:
iamanishx/axeai_m_0.1 - Language: Hinglish (Hindi written in Latin script + English technical vocabulary)
- Parameters: 494M
- Format: Merged standalone weights (
safetensors)
What is New in v0.2
- Expanded Hinglish Corpus: Fine-tuned on the deduplicated
iamanishx/hinglish-dev-dataset(approx. 3,000 conversational and instruction pairs). - Improved Technical Explanations: Capable of explaining web development, system architecture, programming concepts, and writing functional code snippets directly in colloquial Hinglish.
- Standalone Deployment: The LoRA adapter weights have been merged directly into the base weights, eliminating the need to load PEFT modules during inference.
Training Configuration
Trained following modern SFT best practices:
- Method: LoRA SFT on Attention projections (
q_proj,v_proj) - LoRA Rank ($r$): 64
- LoRA Alpha ($\alpha$): 32
- Learning Rate: $1 \times 10^{-3}$ with linear warmup and cosine decay
- Epochs: 2
- Effective Batch Size: 16 (Gradient Accumulation = 16, Per-Device Batch Size = 1)
- Sequence Length: 512
- Precision: bfloat16 / float16
Recommended Inference Settings
For small language models (~0.5B), greedy decoding or low temperature sampling prevents repetition loops and produces crisp, accurate outputs:
- Decoding: Greedy (
do_sample=False) or Low Temperature (temperature=0.3,top_p=0.85) - Repetition Penalty:
1.1 - EOS Tokens:
<|im_end|>(151645) and<|endoftext|>(151643)
Quickstart with Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "iamanishx/axeai_m_0.2"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
if tokenizer.pad_token is None:
tokenizer.pad_token = "<|endoftext|>"
dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=dtype,
device_map="auto",
trust_remote_code=True
)
system_prompt = "Tum ek helpful AI assistant ho. Tum Hinglish mein jawab dete ho, yaani Hindi ko English letters mein likhte ho. Agar user English mein puchhe toh bhi Hinglish mein jawab do."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "React kya hota hai aur iska use kab karna chahiye?"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False, # Greedy decoding for consistent, high-quality responses
repetition_penalty=1.1,
eos_token_id=[151643, 151645]
)
prompt_len = inputs["input_ids"].shape[1]
response = tokenizer.decode(outputs[0][prompt_len:], skip_special_tokens=True)
print(response)
Citation & Credits
- Base model architecture by the Qwen Team (Alibaba Cloud).
- Fine-tuning hyperparameters guided by Baseten Research SFT sweeps.
- Downloads last month
- 255
Model tree for iamanishx/axeai_m_0.2
Base model
iamanishx/axeai_m_0.1