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 #282] Error when trying to save the abliteration result. #161

Closed
opened 2026-11-01 04:18:09 +07:00 by bsakaguchi · 10 comments
Owner

Originally created by @rigin on GitHub (Apr 7, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/282

The abliteration log:
Log.txt
config.toml
config.toml.txt

I saved the model locally and now I can't find it on huggingface.co:

aya-expanse-32b-bnb-4bit

config.json

It's a shame to get horseradish after 15 hours of calculations...)))

Originally created by @rigin on GitHub (Apr 7, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/282 The abliteration log: [Log.txt](https://github.com/user-attachments/files/26524709/Log.txt) config.toml [config.toml.txt](https://github.com/user-attachments/files/26524720/config.toml.txt) I saved the model locally and now I can't find it on huggingface.co: aya-expanse-32b-bnb-4bit [config.json](https://github.com/user-attachments/files/26525433/config.json) It's a shame to get horseradish after 15 hours of calculations...)))
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

If it wasn't uploaded to HF then an error must have been displayed.

Also, you didn't lose anything. There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything.

<!-- gh-comment-id:4196396265 --> @p-e-w commented on GitHub (Apr 7, 2026): If it wasn't uploaded to HF then an error must have been displayed. Also, you didn't lose anything. There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything.
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

I saved the model locally and now I can't find it on huggingface.co:

What do you mean? If you saved locally, why would it be on HF?

<!-- gh-comment-id:4196398104 --> @p-e-w commented on GitHub (Apr 7, 2026): > I saved the model locally and now I can't find it on huggingface.co: What do you mean? If you saved *locally*, why would it be on HF?
Author
Owner

@rigin commented on GitHub (Apr 7, 2026):

I mean the original model. I downloaded it from HF some time ago, used it for abliteration, but now I can't find its page on HF.

<!-- gh-comment-id:4196410479 --> @rigin commented on GitHub (Apr 7, 2026): I mean the original model. I downloaded it from HF some time ago, used it for abliteration, but now I can't find its page on HF.
Author
Owner

@rigin commented on GitHub (Apr 7, 2026):

If it wasn't uploaded to HF then an error must have been displayed.

I downloaded the result locally.

`? What do you want to do with the decensored model? Save the model to a local folder
? Path to the folder: F:\LLMs\aya-expanse-32b-bnb-4bit-abliterated-1
Saving merged model...

  • Merging LoRA adapters into base model...
    C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\peft\tuners\lora\bnb.py:397: UserWarning: Merge lora module to 4-bit linear may get different generations due to rounding errors.
    warnings.warn(
    C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\bitsandbytes\backends\cuda\ops.py:213: FutureWarning: _check_is_size will be removed in a future PyTorch release along with guard_size_oblivious. Use _check(i >= 0) instead.
    torch._check_is_size(blocksize)
    Error:`

Also, you didn't lose anything. There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything.

If I change in the config the parameter quantization = "none" to quantization = "bnb_4bit" does the process start from the checkpoint?

<!-- gh-comment-id:4196450356 --> @rigin commented on GitHub (Apr 7, 2026): > If it wasn't uploaded to HF then an error must have been displayed. I downloaded the result locally. `? What do you want to do with the decensored model? Save the model to a local folder ? Path to the folder: F:\LLMs\aya-expanse-32b-bnb-4bit-abliterated-1 Saving merged model... * Merging LoRA adapters into base model... C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\peft\tuners\lora\bnb.py:397: UserWarning: Merge lora module to 4-bit linear may get different generations due to rounding errors. warnings.warn( C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\bitsandbytes\backends\cuda\ops.py:213: FutureWarning: _check_is_size will be removed in a future PyTorch release along with guard_size_oblivious. Use _check(i >= 0) instead. torch._check_is_size(blocksize) Error:` > Also, you didn't lose anything. There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything. If I change in the config the parameter quantization = "none" to quantization = "bnb_4bit" does the process start from the checkpoint?
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

If I change in the config the parameter quantization = "none" to quantization = "bnb_4bit" does the process start from the checkpoint?

Yes, but the quantization will be reset to the original. Continuing from a checkpoint entails resetting all settings, else the continuation would be inconsistent.

If you want to hack around like this you will have to patch the code.

Note that Heretic doesn't support loading bnb-quantized models that are already quantized on disk. It supports on-the-fly quantization when loading an FP model.

<!-- gh-comment-id:4196461530 --> @p-e-w commented on GitHub (Apr 7, 2026): > If I change in the config the parameter quantization = "none" to quantization = "bnb_4bit" does the process start from the checkpoint? Yes, but the quantization will be reset to the original. Continuing from a checkpoint entails resetting all settings, else the continuation would be inconsistent. If you want to hack around like this you will have to patch the code. Note that Heretic doesn't support loading bnb-quantized models *that are already quantized on disk*. It supports on-the-fly quantization when loading an FP model.
Author
Owner

@rigin commented on GitHub (Apr 7, 2026):

Note that Heretic doesn't support loading bnb-quantized models that are already quantized on disk. It supports on-the-fly quantization when loading an FP model.

That is, you need to take an unquantized model and set the parameter quantization = "bnb_4bit", then with abliteration the model is quantized?

<!-- gh-comment-id:4196493913 --> @rigin commented on GitHub (Apr 7, 2026): > Note that Heretic doesn't support loading bnb-quantized models that are already quantized on disk. It supports on-the-fly quantization when loading an FP model. That is, you need to take an unquantized model and set the parameter quantization = "bnb_4bit", then with abliteration the model is quantized?
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

You take an unquantized model and set quantization = "bnb_4bit".

Heretic will load the model with 4-bit quantization, using about 70% less memory. It will perform abliteration using FP LoRAs, without touching the model in memory.

When you export the model, Heretic will load the full precision model into CPU RAM, and merge the abliteration LoRAs into it, then export the resulting model in full precision.

In other words, you get FP output, but the processing is done using quantization. The best of both worlds, so to speak.

<!-- gh-comment-id:4196516292 --> @p-e-w commented on GitHub (Apr 7, 2026): You take an unquantized model and set `quantization = "bnb_4bit"`. Heretic will load the model with 4-bit quantization, using about 70% less memory. It will perform abliteration using FP LoRAs, without touching the model in memory. When you export the model, **Heretic will load the full precision model into CPU RAM, and merge the abliteration LoRAs into it, then export the resulting model in full precision.** In other words, you get FP output, but the processing is done using quantization. The best of both worlds, so to speak.
Author
Owner

@rigin commented on GitHub (Apr 7, 2026):

There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything.

How can I delete a checkpoint to free up disk space?

<!-- gh-comment-id:4196709903 --> @rigin commented on GitHub (Apr 7, 2026): > There is a checkpoint file created during the run. Just re-run Heretic with the same arguments and it will offer to continue from the checkpoint. You don't have to re-run anything. How can I delete a checkpoint to free up disk space?
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

The checkpoint is just a few kilobytes. It's a tiny JSON file. You can find it in the checkpoints folder.

<!-- gh-comment-id:4196874723 --> @p-e-w commented on GitHub (Apr 7, 2026): The checkpoint is just a few kilobytes. It's a tiny JSON file. You can find it in the `checkpoints` folder.
Author
Owner

@p-e-w commented on GitHub (Jun 16, 2026):

Closing this as I don't see an actionable issue here anymore.

<!-- gh-comment-id:4716215161 --> @p-e-w commented on GitHub (Jun 16, 2026): Closing this as I don't see an actionable issue here anymore.
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#161
No description provided.