Instructions to use nghiemhnlp/HateCOT_Llama_13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nghiemhnlp/HateCOT_Llama_13B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: peft
|
| 3 |
license: apache-2.0
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
tags:
|
| 6 |
+
- hatespeech
|
| 7 |
+
- hatecot
|
| 8 |
+
- cot
|
| 9 |
+
- llama
|
| 10 |
---
|
| 11 |
+
|
| 12 |
+
## Introduction
|
| 13 |
+
This is the LoRA-adapater for the Llama-13B introduced in the paper
|
| 14 |
+
*HateCOT: An Explanation-Enhanced Dataset for Generalizable Offensive Speech Detection via Large Language Models*.
|
| 15 |
+
The base model is instruction-finetuned on 52,000 samples that includes augmented humman annotation to produce
|
| 16 |
+
legible explanations based on predefined criteria in the **provided definition**.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
To use the model, please load along with the original Llama model (detailed configuration in the *Training Procedure*).
|
| 20 |
+
For instruction to load Peft models: https://huggingface.co/docs/transformers/main/en/peft
|
| 21 |
+
|
| 22 |
+
These adapters can also be finetuned on a new set of data. See the article for more details.
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
Use the following template to prompt the model:
|
| 26 |
+
```
|
| 27 |
+
### Instruction
|
| 28 |
+
Perform this task by considering the following Definitions.
|
| 29 |
+
Based on the message, label the input as only one of the following categories:
|
| 30 |
+
[Class 1], [Class 2], ..., or [Class N].
|
| 31 |
+
Provide a brief paragraph to explain step-by-step why the post should be classsified
|
| 32 |
+
with the provided Label based on the given Definitions. If this post targets a group or
|
| 33 |
+
entity relevant to the definition of the specified Label, explain who this target is and how
|
| 34 |
+
that leads to that Label.
|
| 35 |
+
Append the string '<END>' to the end of your response. Provide your response in the following format:
|
| 36 |
+
EXPLANATION: [text]
|
| 37 |
+
LABEL:[text] <END>
|
| 38 |
+
### Definitions:
|
| 39 |
+
[Class 1]: [Definition 1]
|
| 40 |
+
[Class 2]: [Definition 2]
|
| 41 |
+
...
|
| 42 |
+
[Class N]: [Definition 3]
|
| 43 |
+
### Input
|
| 44 |
+
{post}
|
| 45 |
+
### Response:
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## Citation
|
| 49 |
+
```bibtex
|
| 50 |
+
@article{nghiem2024hatecot,
|
| 51 |
+
title={HateCOT: An Explanation-Enhanced Dataset for Generalizable Offensive Speech Detection via Large Language Models},
|
| 52 |
+
author={Nghiem, Huy and Daum{\'e} III, Hal},
|
| 53 |
+
journal={arXiv preprint arXiv:2403.11456},
|
| 54 |
+
year={2024}
|
| 55 |
+
}
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Original Model
|
| 59 |
+
Please visit the main repository to gain permission to download original model weights.
|
| 60 |
+
|
| 61 |
+
https://huggingface.co/meta-llama
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
## Training procedure
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
The following `bitsandbytes` quantization config was used during training:
|
| 69 |
+
- quant_method: bitsandbytes
|
| 70 |
+
- load_in_8bit: True
|
| 71 |
+
- load_in_4bit: False
|
| 72 |
+
- llm_int8_threshold: 6.0
|
| 73 |
+
- llm_int8_skip_modules: None
|
| 74 |
+
- llm_int8_enable_fp32_cpu_offload: False
|
| 75 |
+
- llm_int8_has_fp16_weight: False
|
| 76 |
+
- bnb_4bit_quant_type: nf4
|
| 77 |
+
- bnb_4bit_use_double_quant: False
|
| 78 |
+
- bnb_4bit_compute_dtype: float16
|
| 79 |
+
### Framework versions
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
- PEFT 0.5.0
|