Sumandora/remove-refusals-with-transformers
소개
순수 HF Transformers를 사용해 유해/무해 거부 응답 제거를 구현합니다
기타 프로젝트측정된 스타 증가
- in 24h
- +4
- in 7 days
- +17
- in 15 days
- +55
- in 1 month
- +95
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
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
관련 프로젝트 살펴보기
불러오는 중…