Fevzi KILAS
commited on
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- NIEXCHE/turkish_agriculture_QA_llama2_22.6k
|
| 5 |
+
language:
|
| 6 |
+
- tr
|
| 7 |
+
- en
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Model Card for LLaMA-2-7B-NIEXCHE
|
| 11 |
+
|
| 12 |
+
This model was fine-tuned from LLaMA-2-7B on a Turkish agriculture QA dataset. It supports both Turkish and English languages and was trained for use in agriculture-related natural language processing (NLP) tasks.
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
|
| 16 |
+
### Model Description
|
| 17 |
+
|
| 18 |
+
- **Developed by:** NIEXCHE (Fevzi KILAS)
|
| 19 |
+
- **Finetuned from model:** [meta-llama/Llama-2-7b](https://huggingface.co/meta-llama/Llama-2-7b)
|
| 20 |
+
- **License:** Apache-2.0
|
| 21 |
+
- **Language(s) (NLP):** Turkish, English
|
| 22 |
+
- **Model type:** LLaMA-2-based model
|
| 23 |
+
- **Training Dataset:** [NIEXCHE/turkish_agriculture_QA_llama2_22.6k](https://huggingface.co/datasets/NIEXCHE/turkish_agriculture_QA_llama2_22.6k)
|
| 24 |
+
|
| 25 |
+
### Model Sources
|
| 26 |
+
|
| 27 |
+
- **Repository:** [Model Repository (TBA)](#)
|
| 28 |
+
- **Demo:** [TBA](#)
|
| 29 |
+
|
| 30 |
+
## Uses
|
| 31 |
+
|
| 32 |
+
### Direct Use
|
| 33 |
+
|
| 34 |
+
The model can be used directly for question-answering tasks related to agriculture in Turkish and English. It is fine-tuned specifically for agricultural Q&A, making it suitable for similar domains and use cases.
|
| 35 |
+
|
| 36 |
+
### Out-of-Scope Use
|
| 37 |
+
|
| 38 |
+
The model might not perform well on general knowledge questions outside of the agriculture domain.
|
| 39 |
+
|
| 40 |
+
## Training Details
|
| 41 |
+
|
| 42 |
+
### Training Data
|
| 43 |
+
|
| 44 |
+
The training data was a custom dataset created by translating and cleaning agricultural QA data from [this source](https://huggingface.co/datasets/KisanVaani/agriculture-qa-english-only). The dataset contains 22.6k question-answer pairs in Turkish.
|
| 45 |
+
|
| 46 |
+
### Training Procedure
|
| 47 |
+
|
| 48 |
+
The model was trained using the following frameworks and libraries:
|
| 49 |
+
- **Frameworks:** PyTorch, `transformers`, `accelerate==0.21.0`, `peft==0.4.0`, `bitsandbytes==0.40.2`, `trl==0.4.7`
|
| 50 |
+
- **Precision:** The model was trained using 4-bit quantization (BNB) with mixed precision (`float16`) to optimize memory usage.
|
| 51 |
+
|
| 52 |
+
#### Training Hyperparameters
|
| 53 |
+
|
| 54 |
+
- **Base Model:** `meta-llama/Llama-2-7b`
|
| 55 |
+
- **Batch Size:** 4 (per device)
|
| 56 |
+
- **Learning Rate:** 2e-4
|
| 57 |
+
- **LoRA Parameters:**
|
| 58 |
+
- lora_r = 64
|
| 59 |
+
- lora_alpha = 16
|
| 60 |
+
- lora_dropout = 0.1
|
| 61 |
+
- **Epochs:** 1
|
| 62 |
+
- **Optimizer:** Paged AdamW (32-bit)
|
| 63 |
+
- **Gradient Accumulation Steps:** 1
|
| 64 |
+
- **Scheduler:** Cosine
|
| 65 |
+
- **Max Gradient Norm:** 0.3
|
| 66 |
+
- **Gradient Checkpointing:** Enabled
|
| 67 |
+
- **Warmup Ratio:** 0.03
|
| 68 |
+
- **Group by Length:** Enabled
|
| 69 |
+
- **Max Sequence Length:** None
|
| 70 |
+
|
| 71 |
+
### Hardware
|
| 72 |
+
|
| 73 |
+
- **Training Hardware:** Google Colab Pro (A100 GPU) and 53 GB system RAM.
|
| 74 |
+
- **Training Time:** Approximately 1 hour 40 minutes.
|
| 75 |
+
|
| 76 |
+
Training output:
|
| 77 |
+
`TrainOutput(global_step=5654, training_loss=0.7829279924898043, metrics={'train_runtime': 6029.996, 'train_samples_per_second': 3.75, 'train_steps_per_second': 0.938, 'total_flos': 5.516196145999872e+16, 'train_loss': 0.7829279924898043, 'epoch': 1.0})`
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
## Evaluation
|
| 82 |
+
|
| 83 |
+
The same dataset (`NIEXCHE/turkish_agriculture_QA_llama2_22.6k`) was used for evaluation purposes.
|
| 84 |
+
|
| 85 |
+
## Environmental Impact
|
| 86 |
+
|
| 87 |
+
Carbon emissions were estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute).
|
| 88 |
+
|
| 89 |
+
- **Hardware Type:** Google Colab (A100 GPU)
|
| 90 |
+
- **Hours used:** 1 hour 40 minutes
|
| 91 |
+
- **Compute Region:** Google Cloud (Colab)
|
| 92 |
+
- **Carbon Emitted:** Estimations pending
|
| 93 |
+
|
| 94 |
+
## Citation
|
| 95 |
+
|
| 96 |
+
If you use this model in your research or applications, please cite it as:
|
| 97 |
+
|
| 98 |
+
```bibtex
|
| 99 |
+
@misc{Fevzi2024LLaMA-2-7B-NIEXCHE,
|
| 100 |
+
author = {Fevzi KILAS},
|
| 101 |
+
title = {LLaMA-2-7B-NIEXCHE: A Turkish Agriculture QA Model},
|
| 102 |
+
year = {2024},
|
| 103 |
+
howpublished = {https://huggingface.co/NIEXCHE/turkish_agriculture_QA_llama2_22.6k}
|
| 104 |
+
}
|
| 105 |
+
```
|
| 106 |
+
## Contact:
|
| 107 |
+
|
| 108 |
+
[NIEXCHE (Fevzi KILAS)](https://niexche.github.io/)
|