Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/FailSpy/abliterator
/ functions
Functions
49 in github.com/FailSpy/abliterator
⨍
Functions
49
◇
Types & classes
2
↓ 5 callers
Method
tokenize_instructions_fn
( self, instructions: List[str] )
abliterator.py:296
↓ 4 callers
Function
measure_fn
(measure: str, input_tensor: Tensor, *args, **kwargs)
abliterator.py:72
↓ 3 callers
Method
calculate_mean_dirs
(self, key: str, include_overall_mean: bool = False)
abliterator.py:225
↓ 3 callers
Method
run_with_cache
( self, *model_args, names_filter: Callable[[str], bool] = None, incl_bwd: boo
abliterator.py:361
↓ 2 callers
Function
clear_mem
()
abliterator.py:68
↓ 2 callers
Method
create_activation_cache
( self, toks, N: int = 128, batch_size: int = 8, last_indices: int = 1
abliterator.py:599
↓ 2 callers
Method
do_resid
(self, fn_name: str)
abliterator.py:522
↓ 2 callers
Method
generate_logits
( self, toks: Int[Tensor, 'batch_size seq_len'], *args, drop_refusals: bool =
abliterator.py:303
↓ 2 callers
Method
get_all_act_names
(self, activation_layers: List[str] = None)
abliterator.py:222
↓ 2 callers
Method
get_whitelisted_layers
(self)
abliterator.py:219
↓ 2 callers
Method
measure_scores
( self, N: int = 4, sampled_token_ct: int = 8, measure: str = 'max', b
abliterator.py:488
↓ 2 callers
Method
measure_scores_from_logits
( self, logits: Float[Tensor, 'batch_size seq_len d_vocab'], sequence: int, me
abliterator.py:505
↓ 2 callers
Function
prepare_dataset
(dataset:Tuple[List[str], List[str]]|List[str])
abliterator.py:48
↓ 2 callers
Method
refusal_dirs
(self, invert: bool = False)
abliterator.py:260
↓ 2 callers
Method
unembed_resid
(self, resid: Float[Tensor, "layer batch d_model"], pos: int = -1)
abliterator.py:536
↓ 1 callers
Method
apply_refusal_dirs
( self, refusal_dirs: List[Float[Tensor, 'd_model']], W_O: bool = True, mlp: b
abliterator.py:402
↓ 1 callers
Function
batch
(iterable, n)
abliterator.py:19
↓ 1 callers
Method
format
(self,instruction)
abliterator.py:90
↓ 1 callers
Method
generate
( self, prompt: List[str]|str, *model_args, max_tokens_generated: int = 64,
abliterator.py:330
↓ 1 callers
Method
get_avg_projections
(self, key: str, direction: Float[Tensor, 'd_model'])
abliterator.py:250
↓ 1 callers
Method
test_dir
( self, refusal_dir: Float[Tensor, 'd_model'], activation_layers: List[str] = None,
abliterator.py:441
Method
__enter__
(self)
abliterator.py:93
Method
__enter__
(self)
abliterator.py:173
Method
__exit__
(self,exc,exc_value,exc_tb)
abliterator.py:98
Method
__exit__
(self,exc,exc_value,exc_tb)
abliterator.py:181
Method
__init__
(self,model,template)
abliterator.py:86
Method
__init__
( self, model: str, dataset: Tuple[List[str], List[str]]|List[Tuple[List[str], List[st
abliterator.py:107
Method
accumulated_resid
(self)
abliterator.py:533
Method
activation_layering
(namefunc: str)
abliterator.py:375
Method
blacklist_layer
(self, layer: int|List[int])
abliterator.py:200
Method
cache_activations
( self, N: int = 128, batch_size: int = 8, measure_refusal: int = 0, l
abliterator.py:629
Method
checkpoint
(self)
abliterator.py:194
Method
create_layer_rankings
( self, token_set: List[int]|Set[int]|Int[Tensor, '...'], decompose: bool = True,
abliterator.py:543
Method
decomposed_resid
(self)
abliterator.py:530
Function
directional_hook
( activation: Float[Tensor, "... d_model"], hook: HookPoint, direction: Float[Tensor, "d_model"] )
abliterator.py:57
Method
find_best_refusal_dir
( self, N: int = 4, positive: bool = False, use_hooks: bool = True, in
abliterator.py:472
Function
get_harmful_instructions
()
abliterator.py:27
Function
get_harmless_instructions
()
abliterator.py:36
Method
get_layer_dirs
(self, layer, key: str = None, include_overall_mean: bool=False)
abliterator.py:254
Method
get_layer_of_act_name
(self, ref: str)
abliterator.py:276
Method
induce_refusal_dir
( self, refusal_dir: Float[Tensor, 'd_model'], W_O: bool = True, mlp: bool = T
abliterator.py:421
Method
layer_attn
(self, layer: int, replacement: Float[Tensor, "d_model"] = None)
abliterator.py:280
Method
layer_mlp
(self, layer: int, replacement: Float[Tensor, "d_model"] = None)
abliterator.py:288
Method
mse_positive
( self, N: int = 128, batch_size: int = 8, last_indices: int = 1 )
abliterator.py:566
Method
reset_state
(self)
abliterator.py:189
Method
save_activations
(self, fname: str)
abliterator.py:216
Method
scored_dirs
(self,invert = False)
abliterator.py:272
Method
test
( self, *args, test_set: List[str] = None, N: int = 16, batch_size: in
abliterator.py:347
Method
whitelist_layer
(self,layer: int|List[int])
abliterator.py:208