mlabonne commited on
Commit
ba3070e
1 Parent(s): 963be86

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +13 -38
  2. mergekit_config.yml +2 -2
README.md CHANGED
@@ -1,42 +1,31 @@
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,22 +33,8 @@ 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
- ```
 
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
+ This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
 
 
 
 
12
 
13
+ ## Merge Details
14
+ ### Merge Method
15
 
16
+ 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.
 
 
17
 
18
+ ### Models Merged
19
 
20
+ The following models were included in the merge:
21
 
 
22
 
23
+ ### Configuration
 
 
24
 
25
  The following YAML configuration was used to produce this model:
26
 
27
  ```yaml
28
+ base_model: ./meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
29
  dtype: bfloat16
30
  merge_method: task_arithmetic
31
  parameters:
 
33
  slices:
34
  - sources:
35
  - layer_range: [0, 80]
36
+ model: ./meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
37
  parameters:
38
  weight: 1.0
 
 
 
39
 
40
+ ```
 
 
 
 
 
 
 
 
 
 
 
mergekit_config.yml CHANGED
@@ -1,4 +1,4 @@
1
- base_model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
2
  dtype: bfloat16
3
  merge_method: task_arithmetic
4
  parameters:
@@ -6,6 +6,6 @@ parameters:
6
  slices:
7
  - sources:
8
  - layer_range: [0, 80]
9
- model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
10
  parameters:
11
  weight: 1.0
 
1
+ base_model: ./meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
2
  dtype: bfloat16
3
  merge_method: task_arithmetic
4
  parameters:
 
6
  slices:
7
  - sources:
8
  - layer_range: [0, 80]
9
+ model: ./meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
10
  parameters:
11
  weight: 1.0