Views
No views yet
PASS) in real time.Bajaj Housing Finance ka aaj ka bhav kya hai?Bajaj Housing Finance (BAJAJHFL) ka aaj ka live NSE price hai Rs 86.52 (change neeche -1.27% aaj). Invest karne se pehle apne broker app pe confirm karein. Yeh sirf informational data hai. SEBI registered advisor se zaroor milein.loss ho raha hai portfolio mein kya karein?Bear market mein ghabrana zaroori nahi. Historically markets hamesha recover karte hain - long term investors ke liye yeh buying opportunity hoti hai. SIP jaari rakho, quality stocks hold karo, panic mein mat becho. Yeh sirf educational info hai. SEBI registered advisor se zaroor milein.FD vs mutual fund konsa better hai long term ke liye?FD (Fixed Deposit) mein guaranteed returns milte hain aur risk bahut low hota hai, jabki Mutual Funds market-linked hote hain aur unme high returns ka potential hota hai. Long term wealth creation ke liye Mutual Funds behtar hain, par short term safety ke liye FD secure hai. Apne goal ke hisab se allocate karein. Yeh sirf educational info hai. SEBI registered advisor se zaroor milein.sarvamai/sarvam-1BAJAJHFL, RELIANCE, INFY) and Hinglish financial slang (bhav, mandi, munafa, profit book).| Parameter | Value |
|---|---|
| Base Model | sarvamai/sarvam-1 |
| Method | QLoRA (4-bit quantization via bitsandbytes) |
| Dataset | shravankotagi/hinglish-finance-sft-v5-fixed |
| Hardware | Kaggle T4 GPU (15.6 GB VRAM) |
| LoRA Rank / Alpha | r=16 / alpha=32 (dropout=0.05) |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable Parameters | 23,969,792 / 2,549,463,040 (0.94%) |
| Vocabulary Size | Expanded to 68,195 tokens |
| Epochs / Total Steps | 2 Epochs / 1,174 Steps |
| Optimizer / LR | paged_adamw_8bit / 1e-4 (Cosine Scheduler) |
shravankotagi/hinglish-finance-sft-v5-fixed, an instruction dataset consisting of 5,521 instruction-response pairs covering:| Step | Training Loss | Validation Loss |
|---|---|---|
| 150 | 0.7084 | 0.7169 |
| 300 | 0.6150 | 0.6206 |
| 450 | 0.5472 | 0.5872 |
| 600 | 0.5373 | 0.5665 |
| 750 | 0.4852 | 0.5523 |
| 900 | 0.5248 | 0.5426 |
| 1050 | 0.5042 | 0.5376 |
sarvamai/sarvam-1 in 4-bit mode, resize its embedding layer to match the expanded tokenizer, and apply the PEFT adapter:1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3from peft import PeftModel
4
5MODEL_ID = "shravankotagi/SmartVest"
6
7# 1. Configure 4-bit quantization
8bnb_config = BitsAndBytesConfig(
9 load_in_4bit=True,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_compute_dtype=torch.float16,
12 bnb_4bit_use_double_quant=True,
13)
14
15# 2. Load base model
16base_model = AutoModelForCausalLM.from_pretrained(
17 "sarvamai/sarvam-1",
18 quantization_config=bnb_config,
19 device_map="auto",
20 trust_remote_code=True,
21)
22
23# 3. Load tokenizer and resize embeddings
24tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
25tokenizer.pad_token = tokenizer.eos_token
26base_model.resize_token_embeddings(len(tokenizer))
27
28# 4. Load SmartVest LoRA adapter
29model = PeftModel.from_pretrained(
30 base_model,
31 MODEL_ID,
32 ignore_mismatched_sizes=True
33)
34model.eval()
35
36# 5. Generate
37SYSTEM = """You are SmartVest, an AI assistant for Indian retail investors.
38You understand Hinglish and answer finance questions clearly and factually."""
39
40user_query = "FD vs mutual fund konsa better hai long term ke liye?"
41prompt = f"<s>[INST] {SYSTEM}\n\nUser query: {user_query} [/INST]"
42
43inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
44with torch.no_grad():
45 outputs = model.generate(
46 **inputs,
47 max_new_tokens=120,
48 temperature=0.5,
49 do_sample=True,
50 repetition_penalty=1.1
51 )
52
53response = tokenizer.decode(outputs[0], skip_special_tokens=True)
54print(response.split("[/INST]")[-1].strip())
55