MCPcopy Create free account

hub / github.com/FailSpy/abliterator / functions

Functions49 in github.com/FailSpy/abliterator

↓ 5 callersMethodtokenize_instructions_fn
( self, instructions: List[str] )
abliterator.py:296
↓ 4 callersFunctionmeasure_fn
(measure: str, input_tensor: Tensor, *args, **kwargs)
abliterator.py:72
↓ 3 callersMethodcalculate_mean_dirs
(self, key: str, include_overall_mean: bool = False)
abliterator.py:225
↓ 3 callersMethodrun_with_cache
( self, *model_args, names_filter: Callable[[str], bool] = None, incl_bwd: boo
abliterator.py:361
↓ 2 callersFunctionclear_mem
()
abliterator.py:68
↓ 2 callersMethodcreate_activation_cache
( self, toks, N: int = 128, batch_size: int = 8, last_indices: int = 1
abliterator.py:599
↓ 2 callersMethoddo_resid
(self, fn_name: str)
abliterator.py:522
↓ 2 callersMethodgenerate_logits
( self, toks: Int[Tensor, 'batch_size seq_len'], *args, drop_refusals: bool =
abliterator.py:303
↓ 2 callersMethodget_all_act_names
(self, activation_layers: List[str] = None)
abliterator.py:222
↓ 2 callersMethodget_whitelisted_layers
(self)
abliterator.py:219
↓ 2 callersMethodmeasure_scores
( self, N: int = 4, sampled_token_ct: int = 8, measure: str = 'max', b
abliterator.py:488
↓ 2 callersMethodmeasure_scores_from_logits
( self, logits: Float[Tensor, 'batch_size seq_len d_vocab'], sequence: int, me
abliterator.py:505
↓ 2 callersFunctionprepare_dataset
(dataset:Tuple[List[str], List[str]]|List[str])
abliterator.py:48
↓ 2 callersMethodrefusal_dirs
(self, invert: bool = False)
abliterator.py:260
↓ 2 callersMethodunembed_resid
(self, resid: Float[Tensor, "layer batch d_model"], pos: int = -1)
abliterator.py:536
↓ 1 callersMethodapply_refusal_dirs
( self, refusal_dirs: List[Float[Tensor, 'd_model']], W_O: bool = True, mlp: b
abliterator.py:402
↓ 1 callersFunctionbatch
(iterable, n)
abliterator.py:19
↓ 1 callersMethodformat
(self,instruction)
abliterator.py:90
↓ 1 callersMethodgenerate
( self, prompt: List[str]|str, *model_args, max_tokens_generated: int = 64,
abliterator.py:330
↓ 1 callersMethodget_avg_projections
(self, key: str, direction: Float[Tensor, 'd_model'])
abliterator.py:250
↓ 1 callersMethodtest_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
Methodaccumulated_resid
(self)
abliterator.py:533
Methodactivation_layering
(namefunc: str)
abliterator.py:375
Methodblacklist_layer
(self, layer: int|List[int])
abliterator.py:200
Methodcache_activations
( self, N: int = 128, batch_size: int = 8, measure_refusal: int = 0, l
abliterator.py:629
Methodcheckpoint
(self)
abliterator.py:194
Methodcreate_layer_rankings
( self, token_set: List[int]|Set[int]|Int[Tensor, '...'], decompose: bool = True,
abliterator.py:543
Methoddecomposed_resid
(self)
abliterator.py:530
Functiondirectional_hook
( activation: Float[Tensor, "... d_model"], hook: HookPoint, direction: Float[Tensor, "d_model"] )
abliterator.py:57
Methodfind_best_refusal_dir
( self, N: int = 4, positive: bool = False, use_hooks: bool = True, in
abliterator.py:472
Functionget_harmful_instructions
()
abliterator.py:27
Functionget_harmless_instructions
()
abliterator.py:36
Methodget_layer_dirs
(self, layer, key: str = None, include_overall_mean: bool=False)
abliterator.py:254
Methodget_layer_of_act_name
(self, ref: str)
abliterator.py:276
Methodinduce_refusal_dir
( self, refusal_dir: Float[Tensor, 'd_model'], W_O: bool = True, mlp: bool = T
abliterator.py:421
Methodlayer_attn
(self, layer: int, replacement: Float[Tensor, "d_model"] = None)
abliterator.py:280
Methodlayer_mlp
(self, layer: int, replacement: Float[Tensor, "d_model"] = None)
abliterator.py:288
Methodmse_positive
( self, N: int = 128, batch_size: int = 8, last_indices: int = 1 )
abliterator.py:566
Methodreset_state
(self)
abliterator.py:189
Methodsave_activations
(self, fname: str)
abliterator.py:216
Methodscored_dirs
(self,invert = False)
abliterator.py:272
Methodtest
( self, *args, test_set: List[str] = None, N: int = 16, batch_size: in
abliterator.py:347
Methodwhitelist_layer
(self,layer: int|List[int])
abliterator.py:208