Instructions to use ProfRutPatel/geopolitics-india-qwen2.5-0.5b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ProfRutPatel/geopolitics-india-qwen2.5-0.5b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "ProfRutPatel/geopolitics-india-qwen2.5-0.5b-lora") - Notebooks
- Google Colab
- Kaggle
Geopolitics India - Qwen2.5-0.5B LoRA Adapter
Fine-tuned Qwen2.5-0.5B-Instruct on Global Geopolitical Challenges and India's Response using 4-bit QLoRA on an NVIDIA RTX 3050.
Training Details
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-0.5B-Instruct (500M params) |
| Method | QLoRA (LoRA r=16, alpha=32, NF4 4-bit) |
| Trainable params | 1,081,344 / 495M (0.22%) |
| Epochs | 3 |
| GPU | NVIDIA RTX 3050 Laptop |
| Training time | 48 seconds |
| Final train loss | 3.027 |
| Token accuracy | 49.4% |
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("ProfRutPatel/geopolitics-india-qwen2.5-0.5b-lora")
model = PeftModel.from_pretrained(base, "ProfRutPatel/geopolitics-india-qwen2.5-0.5b-lora")
messages = [{"role": "user", "content": "What are India's key geopolitical challenges?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors='pt')
out = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Sample Output
India faces strategic dependencies in the Indian Ocean, regional security tensions, cybersecurity threats, growing Middle East influence disputes, resource management challenges, and serious climate change impacts on its economy and infrastructure.
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support