File size: 3,011 Bytes
6e0b3d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40d9c5f
 
 
 
 
 
 
 
 
 
 
6e0b3d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
base_model: google/gemma-2-2b-jpn-it
language:
- multilingual
library_name: transformers
license: gemma
license_link: https://ai.google.dev/gemma/terms
pipeline_tag: text-generation
tags:
- nlp
- code
quantized_by: ymcki
widget:
- messages:
  - role: user
    content: Can you provide ways to eat combinations of bananas and dragonfruits?
---

Original model: https://huggingface.co/google/gemma-2-2b-jpn-it

## Prompt format

```
<start_of_turn>user
{prompt}<end_of_turn>
<start_of_turn>model
<end_of_turn>
<start_of_turn>model

```

Note that this model does not support a System prompt.

This is abliterated model of [`google/gemma-2-2b-jpn-it](https://huggingface.co/google/gemma-2-2b-jpn-it) using the 
[method](https://medium.com/@mlabonne/uncensor-any-llm-with-abliteration-d30148b7d43e) 
described by mlabonne.

Layer 18 of the original model was chosen for abliteration.
I also created another layer 17 abliterated model for comparison.

It is uploaded here to be evaluated by the LLM Leaderboard to see how brain damaged it
is compared to the original model.

ORPO fine tuning is currently underway to see if it can regain its sanity. You can play with this model first or wait until I am done with the fine tuning.

## Benchmark (100.0*raw scores only)

Click on the average number to go to the raw score json generated by Open LLM Leaderboard.

| Model | Average | IFEval | BHH | Math Lv5 | MUSR | MMLU-PRO |
| ----- | ------- | ------ | ----|--------- | ---- | -------- |
| [gemma-2-2b-jpn-it](https://huggingface.co/google/gemma-2-2b-jpn-it) | [30.82](https://huggingface.co/datasets/open-llm-leaderboard/results/blob/main/google/gemma-2-2b-jpn-it/results_2024-10-15T15-21-39.173019.json) | 54.11 | 41.43 | 0.0 | 27.52 | 37.17 | 24.67 |
| [gemma-2-2b-jpn-it-abliterated-18](https://huggingface.co/google/gemma-2-2b-jpn-it-abliterated-18) | [16.74](https://huggingface.co/datasets/open-llm-leaderboard/results/raw/main/ymcki/gemma-2-2b-jpn-it-abliterated-18/results_2024-10-16T07-58-03.781979.json) | 0.0 | 29.13 | 0.0 | 25.92 | 33.73 | 11.68 |

Indeed, it is quite dumbed down relative to the original.

## How to run this model

```py
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model_id = "gemma-2-2b-jpn-it-abliterated-18"
dtype = torch.bfloat16

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="cuda",
    torch_dtype=dtype,)

chat = [
    { "role": "user", "content": "Write a hello world program" },
]
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
```

## Downloading using huggingface-cli

First, make sure you have hugginface-cli installed:

```
pip install -U "huggingface_hub[cli]"
```

Then, you can target the specific file you want:

```
huggingface-cli download ymcki/gemma-2-2b-jpn-it-abliterated-18 --include "*" --local-dir ./
```

## Credits

Thank you mlabonne for describing his abliteration method.