shchoi83/agriQA
Viewer β’ Updated β’ 175k β’ 29 β’ 1
How to use nada013/agriqa-assistant with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen1.5-1.8B-Chat")
model = PeftModel.from_pretrained(base_model, "nada013/agriqa-assistant")An intelligent agricultural expert assistant fine-tuned on the agriQA dataset using Qwen1.5-1.8B-Chat with PEFT + LoRA.
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")
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)
The model provides structured responses:
Always follow safety guidelines when applying agricultural practices. The assistant provides general advice - consult local agricultural experts for region-specific recommendations.
This model is trained on the agriQA dataset. For improvements or questions, please refer to the original dataset source.
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
Base model
Qwen/Qwen1.5-1.8B-Chat