🌾 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:

  1. Direct answer to the question
  2. Numbered step-by-step solution
  3. Specific details (measurements, quantities, product names)
  4. Safety precautions if needed
  5. 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

Adapter
(321)
this model

Dataset used to train nada013/agriqa-assistant

Spaces using nada013/agriqa-assistant 2