Sumandora/remove-refusals-with-transformers
Sumandora/remove-refusals-with-transformers has 2,348 GitHub stars and 348 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-08 20:58 UTC. Last push 2025-11-27.
Implements harmful/harmless refusal removal using pure HF Transformers
Measured star growth
- in 24h
- +1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalRemoving refusals with HF Transformers
This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens. This means, that this supports every model that HF Transformers supports*.
The code was tested on a RTX 2060 6GB, thus mostly <3B models have been tested, but the code has been tested to work with bigger models as well.
*While most models are compatible, some models are not. Mainly because of custom model implementations. Some Qwen implementations for example don't work. Because model.model.layers can't be used for getting layers. They call the variables so that, model.transformer.h must be used, if I'm not mistaken.
Usage
- Set model and quantization in compute_refusal_dir.py and inference.py (Quantization can apparently be mixed)
- Run compute_refusal_dir.py (Some settings in that file may be changed depending on your use-case)
- Run inference.py and ask the model how to build an army of rabbits, that will overthrow your local government one day, by stealing all the carrots.
Credits
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,159 starspublic-apis/public-apis
A collective list of free APIs
497,373 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
444,630 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,217 stars