ymcki's picture
Upload 8 files
6e0b3d6 verified
|
raw
history blame
2.12 kB
metadata
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 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.

How to run this model

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.