Downloads · 30 days
22
4% of all-time downloads
bagasbgs2516/llama2-agriculture-lora
llama2-agriculture-lora is a machine learning model from bagasbgs2516. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This model is a fine-tuned version of the meta-llama/Llama-2-7b-hf base model, optimized for agricultural-related instructions and queries. The fine-tuning process utilized the dataset Mahesh2841/Agriculture to improv…
Downloads · 30 days
22
4% of all-time downloads
All-time downloads
528
Public
Repo size
67.6 MB
Likes
1
Public
Click a slice to open those files.
.safetensors67.1 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of the meta-llama/Llama-2-7b-hf base model, optimized for agricultural-related instructions and queries. The fine-tuning process utilized the dataset Mahesh2841/Agriculture to improve the model's ability to answer questions related to agricultural practices, crop management, and related topics.
The model is suitable for:
This model can be further fine-tuned or adapted for specific agricultural tasks, such as:
The model is not suitable for:
Users should be aware of the following limitations:
Use the code below to load and use the model:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model_path = "meta-llama/Llama-2-7b-hf"
lora_model_path = "bagasbgs2516/llama2-agriculture-lora"
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(base_model_path)
# Apply LoRA fine-tuning
model = PeftModel.from_pretrained(base_model, lora_model_path)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_path)
# Generate response
input_text = "What are the best practices for improving soil fertility?"
input_ids = tokenizer.encode(input_text, return_tensors="pt")
output_ids = model.generate(input_ids, max_length=200)
response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(response)
The model was fine-tuned on the dataset Mahesh2841/Agriculture, which contains agricultural-related instructions, inputs, and responses.
Framework: Hugging Face Transformers with PEFT. Precision: Mixed precision (fp16) for faster training. Hardware: NVIDIA A100-SXM4-40GB GPUs. Epochs: 3 Batch size: 1 (gradient accumulation steps: 8) Learning rate: 2e-4
If you use this model in your work, please cite it as follows: @misc{Bagas, 2024, title={LLaMA-2 Fine-Tuned on Agriculture Dataset}, author={Bagas}, year={2024}, publisher={Hugging Face}, url={https://huggingface.co/bagas2516/llama2-agriculture-lora}, }