Text Generation
PEFT
Safetensors
English
Sanskrit
Hindi
Vedas
Hinduism
India
Sanskrit
RigVeda
SamaVeda
YajurVeda
AtharvaVeda
Ayurveda
CharakaSamhita
SushrutaSamhita
RasaJalaNidhi
Qwen
Qwen2.5
lora
unsloth
conversational
Instructions to use shinigamiRaj/IndicVedas-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use shinigamiRaj/IndicVedas-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen2.5-14b-instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "shinigamiRaj/IndicVedas-LoRA") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use shinigamiRaj/IndicVedas-LoRA with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shinigamiRaj/IndicVedas-LoRA to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shinigamiRaj/IndicVedas-LoRA to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shinigamiRaj/IndicVedas-LoRA to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="shinigamiRaj/IndicVedas-LoRA", max_seq_length=2048, )
π VedaGPT LoRA Adapters (IndicVedas-LoRA)
This repository contains the LoRA (Low-Rank Adaptation) adapter weights for VedaGPT (IndicVedas). These adapters are trained on top of the base model Qwen2.5-14B-Instruct using the Unsloth library.
If you are looking for the fully merged model (including GGUF quantizations for Ollama/llama.cpp), please check shinigamiRaj/IndicVedas.
βοΈ LoRA Configuration
- Rank (
r):64 - Alpha (
lora_alpha):64 - Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - LoRA Dropout:
0(Optimized for Unsloth) - Bias:
none
π Training Recipe
The adapters were fine-tuned using serverless cloud GPUs via Modal:
- Dataset: Comprehensive Vedic and Ayurvedic digital corpus (Rig Veda, Sama Veda, Yajur Veda, Atharva Veda, Charaka Samhita, Sushruta Samhita, Rasa Jala Nidhi, etc.).
- Epochs:
2.0full epochs. - Learning Rate:
5e-5(Linear warm-up for 5% of training steps, followed by Cosine decay). - Optimizer:
adamw_8bit. - Weight Decay:
0.05for generalization stability. - Effective Batch Size:
8. - Context Length:
4096tokens.
π οΈ How to load the LoRA Adapters
You can load these adapters in Python using transformers and peft, or directly using unsloth for accelerated performance.
Loading with Unsloth (Recommended)
from unsloth import FastLanguageModel
max_seq_length = 4096
dtype = None # Auto detect
load_in_4bit = True
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "shinigamiRaj/IndicVedas-LoRA",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
# Prepare for inference
FastLanguageModel.for_inference(model)
# Generate text
inputs = tokenizer(
["<|im_start|>system\nYou are VedaGPT...\n<|im_end|>\n<|im_start|>user\nTell me about Agni in Rig Veda.<|im_end|>\n<|im_start|>assistant\n"],
return_tensors = "pt"
).to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 512, use_cache = True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Loading with standard PEFT & Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "Qwen/Qwen2.5-14B-Instruct"
adapter_model_name = "shinigamiRaj/IndicVedas-LoRA"
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, adapter_model_name)
π Prompt Format
This model uses the ChatML markup structure:
<|im_start|>system
You are VedaGPT, an expert scholar of the ancient Vedic scriptures...<|im_end|>
<|im_start|>user
Describe the concept of digestion (Agni) in Charaka Samhita.<|im_end|>
<|im_start|>assistant
...
- Downloads last month
- 153