🌱 AgriBot — A Fine-tuned Agriculture Assistant (LoRA)
AgriBot is a lightweight language model fine-tuned to assist farmers and agri-stakeholders with agriculture-related queries using LoRA (Low-Rank Adaptation). It is based on the distilgpt2 model and trained on a curated dataset of agricultural Q&A to deliver relevant, natural-language answers.
🔍 Model Details
- Base Model:
distilgpt2 - Fine-tuning Method: LoRA (Low-Rank Adaptation)
- Dataset Used:
Keshav022/Agriculture-Dataset - Training Platform: Google Colab with 8-bit quantization (
bitsandbytes) - Frameworks: Hugging Face
transformers,peft,datasets
📚 Dataset Summary
The dataset contains real-world agriculture-related questions and answers including topics such as:
- Crop selection and yield optimization
- Soil nutrient management
- Fertilizer and pesticide usage
- Plant disease control
- Seasonal farming practices
We used a cleaned and shuffled subset (~10,000 examples) for efficient training within limited compute resources.
🧠 Training Configuration
| Setting | Value |
|---|---|
| Model | distilgpt2 |
| Parameter-efficient method | LoRA |
LoRA Rank (r) |
8 |
| Epochs | 3 |
| Max Tokens per Input | 128 |
| Optimizer | AdamW |
| Learning Rate | 2e-4 |
| Quantization | 8-bit (via bitsandbytes) |
| Platform | Google Colab (Free) |
🗣️ Example Usage
from transformers import pipeline
pipe = pipeline("text-generation", model="subbuks/agribot-lora")
output = pipe("Q: How to increase tomato yield?\nA:",
max_new_tokens=50,
temperature=0.7,
top_p=0.95,
repetition_penalty=1.2,
do_sample=True)
print(output[0]['generated_text'])
💡 Sample Output
Input:
Q: How to increase tomato yield? A:
Output:
A: Apply organic compost, maintain proper spacing, and water regularly. Use phosphorus-rich fertilizer during flowering.
⚠️ Limitations
Not suitable for high-stakes decision-making without expert verification.
Might hallucinate or repeat answers if generation parameters are not well-tuned.
Trained on English data; multilingual support is not included.
👤 Author
Created by [subbuks] Model hosted on Hugging Face at: https://huggingface.co/subbuks/agribot-lora