Update README.md
Browse files
README.md
CHANGED
@@ -1,31 +1,42 @@
|
|
1 |
---
|
2 |
-
base_model: []
|
3 |
library_name: transformers
|
|
|
|
|
4 |
tags:
|
|
|
|
|
5 |
- mergekit
|
6 |
-
- merge
|
7 |
-
|
8 |
---
|
|
|
9 |
# Llama-3.1-70B-Instruct-abliterated
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
### Merge Method
|
15 |
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
The
|
21 |
|
|
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
The following YAML configuration was used to produce this model:
|
26 |
|
27 |
```yaml
|
28 |
-
base_model:
|
29 |
dtype: bfloat16
|
30 |
merge_method: task_arithmetic
|
31 |
parameters:
|
@@ -33,8 +44,22 @@ parameters:
|
|
33 |
slices:
|
34 |
- sources:
|
35 |
- layer_range: [0, 80]
|
36 |
-
model:
|
37 |
parameters:
|
38 |
weight: 1.0
|
39 |
-
|
40 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
|
|
2 |
library_name: transformers
|
3 |
+
license: llama3.1
|
4 |
+
base_model: meta-llama/Meta-Llama-3.1-70B-Instruct
|
5 |
tags:
|
6 |
+
- abliterated
|
7 |
+
- uncensored
|
8 |
- mergekit
|
|
|
|
|
9 |
---
|
10 |
+
|
11 |
# Llama-3.1-70B-Instruct-abliterated
|
12 |
|
13 |
+
![KhorYYG.png](https://i.imgur.com/KhorYYG.png)
|
14 |
|
15 |
+
This is an uncensored version of [Llama 3.1 70B Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct) created with abliteration (see [this article](https://huggingface.co/blog/mlabonne/abliteration) to know more about it) using [@grimjim](https://huggingface.co/grimjim)'s recipe.
|
|
|
16 |
|
17 |
+
More precisely, this is a **LoRA-abliterated** model:
|
18 |
+
|
19 |
+
1. **Extraction**: We extract a LoRA adapter by comparing two models: a censored Llama 3 and an abliterated Llama 3
|
20 |
+
2. **Merge**: We merge this new LoRA adapter using [task arithmetic](https://arxiv.org/abs/2212.04089) to a censored Llama 3.1 to abliterate it.
|
21 |
|
22 |
+
I adapted this recipe to Llama 3.1 70B using [failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5](https://huggingface.co/failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5) and optimized the LoRA rank.
|
23 |
|
24 |
+
The model is fully uncensored in my tests and maintains a high level of quality. A more rigorous evaluation is still needed to measure the impact of this process on benchmarks.
|
25 |
|
26 |
+
Special thanks to [@grimjim](https://huggingface.co/grimjim) for this technique (see his [8B model](https://huggingface.co/grimjim/Llama-3.1-8B-Instruct-abliterated_via_adapter)) and [@FailSpy](https://huggingface.co/failspy) for his [70B abliterated model](https://huggingface.co/failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5). Please follow them if you're interested in abliterated models.
|
27 |
|
28 |
+
In addition, thanks to [brev.dev](https://brev.dev/) for providing me with compute!
|
29 |
+
|
30 |
+
## ⚡️ Quantization
|
31 |
+
|
32 |
+
This model was merged using the [task arithmetic](https://arxiv.org/abs/2212.04089) merge method using ./meta-llama/Meta-Llama-3.1-70B-Instruct + Llama-3-70B-Instruct-abliterated-LORA as a base.
|
33 |
+
|
34 |
+
## 🧩 Configuration
|
35 |
|
36 |
The following YAML configuration was used to produce this model:
|
37 |
|
38 |
```yaml
|
39 |
+
base_model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
|
40 |
dtype: bfloat16
|
41 |
merge_method: task_arithmetic
|
42 |
parameters:
|
|
|
44 |
slices:
|
45 |
- sources:
|
46 |
- layer_range: [0, 80]
|
47 |
+
model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
|
48 |
parameters:
|
49 |
weight: 1.0
|
|
|
50 |
```
|
51 |
+
|
52 |
+
You can reproduce this model using the following commands:
|
53 |
+
|
54 |
+
```bash
|
55 |
+
# Setup
|
56 |
+
git clone https://github.com/arcee-ai/mergekit.git
|
57 |
+
cd mergekit && pip install -e .
|
58 |
+
pip install bitsandbytes
|
59 |
+
|
60 |
+
# Extraction
|
61 |
+
mergekit-extract-lora failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5 meta-llama/Meta-Llama-3-70B-Instruct Llama-3-70B-Instruct-abliterated-LORA --rank=64
|
62 |
+
|
63 |
+
# Merge using previous config
|
64 |
+
mergekit-yaml config.yaml Llama-3.1-70B-Instruct-abliterated --allow-crimes --lora-merge-cache=./cache
|
65 |
+
```
|