1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #112] Support for translategemma #62

Closed
opened 2026-11-01 04:17:07 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @teresch-a on GitHub (Jan 18, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/112

Is there any way to support translategemma? Or their license required to be signed before downloading from hf will prevent it? Tried to abliterate it with current version, but it's as they said, it seems to be strongly biased to proper prompting. Well, or i'm doing sth wrong.

PS E:\LLMs\hf> heretic google/translategemma-27b-it
█░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀  v1.1.0
█▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░
▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀  https://github.com/p-e-w/heretic

GPU type: NVIDIA GeForce RTX 5090

Loading model google/translategemma-27b-it...
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:09<00:00,  1.22it/s]
Some parameters are on the meta device because they were offloaded to the cpu.
Failed (Conversations must start with a user prompt.)
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:19<00:00,  1.64s/it]
Some parameters are on the meta device because they were offloaded to the cpu.
Failed (Conversations must start with a user prompt.)
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:21<00:00,  1.79s/it]
Some parameters are on the meta device because they were offloaded to the cpu.
Failed (Conversations must start with a user prompt.)
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:13<00:00,  1.11s/it]
Some parameters are on the meta device because they were offloaded to the disk and cpu.
Failed (Conversations must start with a user prompt.)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198                                                                       │
│ in _run_code:88                                                                                  │
│                                                                                                  │
│ in <module>:6                                                                                    │
│                                                                                                  │
│   3 if __name__ == '__main__':                                                                   │
│   4 │   if sys.argv[0].endswith('.exe'):                                                         │
│   5 │   │   sys.argv[0] = sys.argv[0][:-4]                                                       │
│ ❱ 6 │   sys.exit(main())                                                                         │
│   7                                                                                              │
│                                                                                                  │
│ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\main.py:576 in    │
│ main                                                                                             │
│                                                                                                  │
│   573 │   install()                                                                              │
│   574 │                                                                                          │
│   575 │   try:                                                                                   │
│ ❱ 576 │   │   run()                                                                              │
│   577 │   except BaseException as error:                                                         │
│   578 │   │   # Transformers appears to handle KeyboardInterrupt (or BaseException)              │
│   579 │   │   # internally in some places, which can re-raise a different error in the handler   │
│                                                                                                  │
│ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\main.py:133 in    │
│ run                                                                                              │
│                                                                                                  │
│   130 │   # Silence the warning about multivariate TPE being experimental.                       │
│   131 │   warnings.filterwarnings("ignore", category=ExperimentalWarning)                        │
│   132 │                                                                                          │
│ ❱ 133 │   model = Model(settings)                                                                │
│   134 │                                                                                          │
│   135 │   print()                                                                                │
│   136 │   print(f"Loading good prompts from [bold]{settings.good_prompts.dataset}[/]...")        │
│                                                                                                  │
│ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\model.py:92 in    │
│ __init__                                                                                         │
│                                                                                                  │
│    89 │   │   │   break                                                                          │
│    90 │   │                                                                                      │
│    91 │   │   if self.model is None:                                                             │
│ ❱  92 │   │   │   raise Exception("Failed to load model with all configured dtypes.")            │
│    93 │   │                                                                                      │
│    94 │   │   print(f"* Transformer model with [bold]{len(self.get_layers())}[/] layers")        │
│    95 │   │   print("* Abliterable components:")                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Exception: Failed to load model with all configured dtypes.

It's a shame if it would not be possible to add heretic abliteration for this model, because my current best translation model is dphn/Dolphin-Mistral-24B-Venice-Edition abliterated with heretic.
Weirdly enough, i'd say that heretic fixed some dumbness that was added after Dolphin made their changes to the Mistral model to make it less censored.
Black magic, really.

Originally created by @teresch-a on GitHub (Jan 18, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/112 Is there any way to support translategemma? Or their license required to be signed before downloading from hf will prevent it? Tried to abliterate it with current version, but it's as they said, it seems to be strongly biased to proper prompting. Well, or i'm doing sth wrong. ``` PS E:\LLMs\hf> heretic google/translategemma-27b-it █░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀ v1.1.0 █▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░ ▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀ https://github.com/p-e-w/heretic GPU type: NVIDIA GeForce RTX 5090 Loading model google/translategemma-27b-it... Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:09<00:00, 1.22it/s] Some parameters are on the meta device because they were offloaded to the cpu. Failed (Conversations must start with a user prompt.) Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:19<00:00, 1.64s/it] Some parameters are on the meta device because they were offloaded to the cpu. Failed (Conversations must start with a user prompt.) Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:21<00:00, 1.79s/it] Some parameters are on the meta device because they were offloaded to the cpu. Failed (Conversations must start with a user prompt.) Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 12/12 [00:13<00:00, 1.11s/it] Some parameters are on the meta device because they were offloaded to the disk and cpu. Failed (Conversations must start with a user prompt.) ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ in _run_module_as_main:198 │ │ in _run_code:88 │ │ │ │ in <module>:6 │ │ │ │ 3 if __name__ == '__main__': │ │ 4 │ if sys.argv[0].endswith('.exe'): │ │ 5 │ │ sys.argv[0] = sys.argv[0][:-4] │ │ ❱ 6 │ sys.exit(main()) │ │ 7 │ │ │ │ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\main.py:576 in │ │ main │ │ │ │ 573 │ install() │ │ 574 │ │ │ 575 │ try: │ │ ❱ 576 │ │ run() │ │ 577 │ except BaseException as error: │ │ 578 │ │ # Transformers appears to handle KeyboardInterrupt (or BaseException) │ │ 579 │ │ # internally in some places, which can re-raise a different error in the handler │ │ │ │ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\main.py:133 in │ │ run │ │ │ │ 130 │ # Silence the warning about multivariate TPE being experimental. │ │ 131 │ warnings.filterwarnings("ignore", category=ExperimentalWarning) │ │ 132 │ │ │ ❱ 133 │ model = Model(settings) │ │ 134 │ │ │ 135 │ print() │ │ 136 │ print(f"Loading good prompts from [bold]{settings.good_prompts.dataset}[/]...") │ │ │ │ C:\Users\ALT\AppData\Local\Programs\Python\Python314\Lib\site-packages\heretic\model.py:92 in │ │ __init__ │ │ │ │ 89 │ │ │ break │ │ 90 │ │ │ │ 91 │ │ if self.model is None: │ │ ❱ 92 │ │ │ raise Exception("Failed to load model with all configured dtypes.") │ │ 93 │ │ │ │ 94 │ │ print(f"* Transformer model with [bold]{len(self.get_layers())}[/] layers") │ │ 95 │ │ print("* Abliterable components:") │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ Exception: Failed to load model with all configured dtypes. ``` It's a shame if it would not be possible to add heretic abliteration for this model, because my current best translation model is dphn/Dolphin-Mistral-24B-Venice-Edition abliterated with heretic. Weirdly enough, i'd say that heretic fixed some dumbness that was added after Dolphin made their changes to the Mistral model to make it less censored. Black magic, really.
Author
Owner

@feld commented on GitHub (Apr 23, 2026):

I wanted to test this as well to see if it can pass the evaluation but ran into this problem... so I just asked Qwen to fix Heretic to work for translategemma and this is what it came up with. I was able to do the evaluation against the 4b as you can see below:

Detected 1 CUDA device(s) (15.45 GB total VRAM)
CUDA Version: 13.0
Driver Version: 595.58.03
* CUDA 0: NVIDIA GeForce RTX 5070 Ti (15.45 GB)

Loading model google/translategemma-4b-it...
No chat template available for google/translategemma-4b-it. Using raw text prompting.
* Trying dtype auto...
* LoRA adapters initialized (target types: down_proj, o_proj)
* Transformer model with 34 layers
* Abliterable components:
  * attn.o_proj: 34 modules total
  * mlp.down_proj: 34 modules total

Resident system RAM: 1.88 GB
Allocated GPU VRAM: 8.02 GB
Reserved GPU VRAM: 8.03 GB

Loading good prompts from mlabonne/harmless_alpaca...
* 400 prompts loaded

Loading bad prompts from mlabonne/harmful_behaviors...
* 400 prompts loaded

Determining optimal batch size...
* Trying batch size 1... Ok (68 tokens/s)
* Trying batch size 2... Ok (117 tokens/s)
* Trying batch size 4... Ok (230 tokens/s)
* Trying batch size 8... Ok (468 tokens/s)
* Trying batch size 16... Ok (851 tokens/s)
* Trying batch size 32... Ok (1536 tokens/s)
* Trying batch size 64... Ok (2409 tokens/s)
* Trying batch size 128... Ok (2783 tokens/s)
* Chosen batch size: 128

Checking for common response prefix...
* None found

Loading good evaluation prompts from mlabonne/harmless_alpaca...
* 100 prompts loaded
* Obtaining first-token probability distributions...

Loading bad evaluation prompts from mlabonne/harmful_behaviors...
* 100 prompts loaded
* Counting model refusals...
* Initial refusals: 84/100

Loading model google/translategemma-4b-it...
* Evaluating...
  * Obtaining first-token probability distributions...
  * KL divergence: 0.0000
  * Counting model refusals...
  * Refusals: 84/100

translategemma.patch

<!-- gh-comment-id:4308297085 --> @feld commented on GitHub (Apr 23, 2026): I wanted to test this as well to see if it can pass the evaluation but ran into this problem... so I just asked Qwen to fix Heretic to work for translategemma and this is what it came up with. I was able to do the evaluation against the 4b as you can see below: ``` Detected 1 CUDA device(s) (15.45 GB total VRAM) CUDA Version: 13.0 Driver Version: 595.58.03 * CUDA 0: NVIDIA GeForce RTX 5070 Ti (15.45 GB) Loading model google/translategemma-4b-it... No chat template available for google/translategemma-4b-it. Using raw text prompting. * Trying dtype auto... * LoRA adapters initialized (target types: down_proj, o_proj) * Transformer model with 34 layers * Abliterable components: * attn.o_proj: 34 modules total * mlp.down_proj: 34 modules total Resident system RAM: 1.88 GB Allocated GPU VRAM: 8.02 GB Reserved GPU VRAM: 8.03 GB Loading good prompts from mlabonne/harmless_alpaca... * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... * 400 prompts loaded Determining optimal batch size... * Trying batch size 1... Ok (68 tokens/s) * Trying batch size 2... Ok (117 tokens/s) * Trying batch size 4... Ok (230 tokens/s) * Trying batch size 8... Ok (468 tokens/s) * Trying batch size 16... Ok (851 tokens/s) * Trying batch size 32... Ok (1536 tokens/s) * Trying batch size 64... Ok (2409 tokens/s) * Trying batch size 128... Ok (2783 tokens/s) * Chosen batch size: 128 Checking for common response prefix... * None found Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... * Initial refusals: 84/100 Loading model google/translategemma-4b-it... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 0.0000 * Counting model refusals... * Refusals: 84/100 ``` [translategemma.patch](https://github.com/user-attachments/files/27027868/translategemma.patch)
Author
Owner

@p-e-w commented on GitHub (Oct 12, 2026):

Closing as this is almost certainly supported now.

<!-- gh-comment-id:6124725836 --> @p-e-w commented on GitHub (Oct 12, 2026): Closing as this is almost certainly supported now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#62
No description provided.