πΎ AgriQA Assistant
An intelligent agricultural expert assistant fine-tuned on the agriQA dataset using Qwen1.5-1.8B-Chat with PEFT + LoRA.
π Features
- Clear, practical steps you can apply directly in the field
- Specific measurements and quantities for accurate application
- Safety precautions when needed
- Expert tips for better results
- Structured responses with numbered steps
π§ Technical Details
- Base Model: Qwen/Qwen1.5-1.8B-Chat
- Fine-tuning Method: PEFT + LoRA (Parameter Efficient Fine-tuning)
- Dataset: agriQA (agricultural Q&A pairs)
- Training Data: 50,000 samples with structured prompts
- LoRA Rank: 2
- LoRA Alpha: 4
π± Usage
Direct Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen1.5-1.8B-Chat", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen1.5-1.8B-Chat", trust_remote_code=True)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "nada013/agriqa-assistant")
Chat Format
messages = [
{"role": "system", "content": "You are AgriQA, an agricultural expert assistant..."},
{"role": "user", "content": "How to control aphid infestation in mustard crops?"}
]
# Generate response
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.3)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
π― Response Format
The model provides structured responses:
- Direct answer to the question
- Numbered step-by-step solution
- Specific details (measurements, quantities, product names)
- Safety precautions if needed
- Extra tip or follow-up advice
π‘ Example Questions
- "How to control aphid infestation in mustard crops?"
- "What fertilizer should I use for coconut plants?"
- "How to increase milk production in cows?"
- "What is the treatment for white diarrhoea in poultry?"
- "How to preserve potato tubers for 7-8 months?"
π Safety Note
Always follow safety guidelines when applying agricultural practices. The assistant provides general advice - consult local agricultural experts for region-specific recommendations.
π Training Details
- Epochs: 1
- Learning Rate: 5e-4
- Batch Size: 1 (with gradient accumulation)
- Max Length: 256 tokens
- Optimizer: AdamW with fused implementation
- Hardware: 8GB GPU with 4-bit quantization
π€ Contributing
This model is trained on the agriQA dataset. For improvements or questions, please refer to the original dataset source.
π License
This project uses the Qwen1.5-1.8B-Chat model and agriQA dataset. Please refer to their respective licenses for usage terms.
Built with β€οΈ for the agricultural community
- Downloads last month
- 12
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support
Model tree for nada013/agriqa-assistant
Base model
Qwen/Qwen1.5-1.8B-Chat