概要
純粋な HF Transformers を使って、有害・無害な拒否応答の除去を実装します
その他のプロジェクト計測したスター増加
- 24時間
- +4
- 7日間
- +17
- 15日間
- +55
- 1か月
- +95
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルRemoving 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
関連プロジェクトを探す
読み込み中…