Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TransluceAI/observatory
/ functions
Functions
1,028 in github.com/TransluceAI/observatory
⨍
Functions
1,028
◇
Types & classes
364
↳
Endpoints
7
↓ 1 callers
Function
do_circuit_based_steering_on_batch
( sis_to_get_activations_for: list[SteeringInput], config: CircuitBasedSteeringEvalConfig, exp_con
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:434
↓ 1 callers
Function
do_neuron_interventions_and_get_activations
( subject: PreTrainedModel, input_ids: Tensor, # (batch_size, seq_len) attention_mask: Tensor, #
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:257
↓ 1 callers
Function
do_steering_eval
( config: SteeringEvalConfig, decoder: PeftModel | None = None, subject: PreTrainedModel | None =
project/latentqa/latentqa/eval/steering_eval.py:920
↓ 1 callers
Function
do_steering_on_batch
( sis_to_get_activations_for: list[SteeringInput], config: SteeringEvalConfig, exp_config: LQATrai
project/latentqa/latentqa/eval/steering_eval.py:811
↓ 1 callers
Method
encode_simulation_prompt
Tokenize simulation prompt such that given prefix_ids = tokenize(prefix_messages) input_ids = tokenize(messages), we have:
lib/explanations/explanations/simulation_utils.py:409
↓ 1 callers
Method
evaluate
(self, eval_inputs: list[BeliefEvalInput])
project/user_modeling/user_modeling/belief_eval.py:591
↓ 1 callers
Function
evaluate_reading_using_multiple_choice
( activations_batch: ActivationsList, token_range_from: list[tuple[int, int]], data: list[list[LQA
project/latentqa/latentqa/eval/steering_util.py:166
↓ 1 callers
Function
event_generator
()
project/monitor/monitor/server.py:214
↓ 1 callers
Function
extract_chosen_messages
(conversation)
project/user_modeling/user_modeling/prism.py:30
↓ 1 callers
Function
fetchStats
()
project/monitor/web/app/dashboard/status/page.tsx:25
↓ 1 callers
Method
fetch_all_raw
Return *all* rows satisfying ``conditions`` as Pydantic objects (ignores ``batch_time``/``id`` when constructing the objects).
project/user_modeling/user_modeling/db_wrapper.py:345
↓ 1 callers
Function
filter_activations
(activations: List[float], min_or_max: ExemplarType)
lib/explanations/explanations/explanations.py:368
↓ 1 callers
Function
filter_clusters
Filter clusters based on similarity and size, to surface the most interesting clusters. Then sort the filtered clusters in descending order o
lib/investigator/investigator/clustering.py:253
↓ 1 callers
Method
filter_out_existing_prompts
( self, eval_inputs: list[BeliefEvalInput], eval_type: BeliefEvalType )
project/user_modeling/user_modeling/belief_eval.py:473
↓ 1 callers
Function
find_dotenv
Find the .env file in the project directory. Stops ascending at the project root. Raises an error with the list of paths explored if no .env
lib/util/util/env.py:50
↓ 1 callers
Function
find_project_root
()
project/monitor/monitor/server_modal.py:6
↓ 1 callers
Function
find_subsequence_in_tokens
Find the starting index of needle in haystack. Returns -1 if not found.
project/latentqa/latentqa/decoder_input_util.py:31
↓ 1 callers
Function
format_activation_record_for_neg
( act_rec: ActivationRecord, act_thresh: float )
lib/explanations/explanations/explanation_utils.py:97
↓ 1 callers
Function
format_activation_record_for_pos
( act_rec: ActivationRecord, act_thresh: float )
lib/explanations/explanations/explanation_utils.py:82
↓ 1 callers
Method
format_examples
( self, examples: List[Tuple[str, List[ActivationRecord]]] )
lib/explanations/explanations/explanation_utils.py:524
↓ 1 callers
Method
format_prompt
( self, exemplars: ExemplarsForExplanationGeneration, rng: random.Random, **kw
lib/explanations/explanations/explanation_utils.py:279
↓ 1 callers
Function
format_sequences_for_simulation
Format a list of lists of tokens into a string with each token marked as having an "unknown" or "blank" activation, suitable for use in promp
lib/explanations/explanations/simulation_utils.py:155
↓ 1 callers
Method
from_sample_dicts
Initialize ActivationsList from a list of per-sample activation dictionaries Args: sample_dicts: List where each element is eithe
project/latentqa/latentqa/model_wrapper.py:332
↓ 1 callers
Method
from_yaml
(cls, yaml_path: Path | os.PathLike)
project/latentqa/latentqa/train_util.py:261
↓ 1 callers
Function
fsdp_auto_wrap_policy
(model, transformer_layer_name)
project/latentqa/latentqa/train_util.py:375
↓ 1 callers
Function
genId
()
project/monitor/web/hooks/use-toast.ts:30
↓ 1 callers
Function
generate_and_score_explanation
( explanations_wrapper: ExplanationsWrapper, neurons: np.ndarray, master_process: bool, torchr
project/expgen/scripts/generate_and_score_explanation.py:73
↓ 1 callers
Method
generate_and_validate_prompts
Generate prompts and validate them. Args: attribute_classes: list of attribute classes to use. If not pro
project/user_modeling/user_modeling/synthsys/user_prompts.py:418
↓ 1 callers
Method
generate_explanations_for_neuron
( self, layer: int, neuron_idx: int, overwrite: bool = False )
lib/explanations/explanations/explanations_wrapper.py:214
↓ 1 callers
Function
generate_explanations_for_one_act_sign
( exemplars: ExemplarsForExplanationGeneration, prompt_formatter: ExplainerPromptFormatter, num_ex
lib/explanations/explanations/explanation_utils.py:634
↓ 1 callers
Function
generate_freeform_steering_qas
( start_attr: UserAttribute, target_attr: UserAttribute, generation_config: DataGeneratorConfig,
project/latentqa/latentqa/eval/steering_qas.py:474
↓ 1 callers
Function
generate_full_lqa_data_from_subject_inputs
( config: FullLQADataGenerationConfig, full_data_db_dir: str, max_num_insert: int | None = None,
project/latentqa/latentqa/lqa_data.py:186
↓ 1 callers
Function
generate_html_for_visualizing_neuron_exemplars_and_activations
( layer: int, neuron_idx: int, exemplars: Dict[ExemplarType, List[ActivationRecord]], unnorm_e
lib/activations/activations/exemplars_wrapper.py:143
↓ 1 callers
Function
generate_html_for_visualizing_neuron_exemplars_and_activations_single_sign
( layer: int, neuron_idx: int, exemplars: List[ActivationRecord], unnorm_exemplars: List[Activ
lib/activations/activations/exemplars_wrapper.py:48
↓ 1 callers
Function
generate_mc_steering_qas
( start_attr: UserAttribute, target_attr: UserAttribute, generation_config: DataGeneratorConfig,
project/latentqa/latentqa/eval/steering_qas.py:440
↓ 1 callers
Function
generate_mc_stems
Generate multiple choice question stems for each attribute class using an LLM.
project/latentqa/latentqa/mc_util.py:365
↓ 1 callers
Method
generate_prompts
Generate system prompts for all values of an attribute class
project/user_modeling/user_modeling/synthsys/system_prompts.py:122
↓ 1 callers
Method
generate_qas_batch
( self, subject_inputs: list[MinimalSubjectInput], use_cache: bool = True )
project/latentqa/latentqa/qas.py:347
↓ 1 callers
Function
generate_steering_qas_for_attr_pair
( save_dir: str, start_attr: UserAttribute, target_attr: UserAttribute, rng: np.random.Generat
project/latentqa/latentqa/eval/steering_qas.py:538
↓ 1 callers
Function
generate_system_prompts
( config: SystemPromptGenerationConfig, db_dir: str, attributes: list[UserAttribute] | None = None
project/user_modeling/user_modeling/synthsys/system_prompts.py:217
↓ 1 callers
Function
generate_user_prompts
( config: UserPromptGenerationConfig, db_dir: str, attribute_classes: list[Type[UserAttribute]] |
project/user_modeling/user_modeling/synthsys/user_prompts.py:545
↓ 1 callers
Method
generate_with_intervention
( self, activations: Union[Activations, ActivationsList], token_range_from: list[tuple
project/latentqa/latentqa/model_wrapper.py:609
↓ 1 callers
Function
generator
()
lib/activations/activations/exemplars_computation.py:134
↓ 1 callers
Function
getTokenCustomization
(index: number)
project/monitor/web/app/dashboard/chat/components/tokenselector.tsx:321
↓ 1 callers
Method
get_accuracies
(self)
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:70
↓ 1 callers
Function
get_activation_checkpoints_from_gradient_based_steering
( steering_input: SteeringInput, patch_from_region: PatchFromRegion, exp_config: LQATrainConfig,
project/latentqa/latentqa/eval/steering_eval.py:314
↓ 1 callers
Function
get_activation_checkpoints_list_from_circuit_based_steering
( steering_inputs: list[SteeringInput], neurons_list: list[tuple[int, int, NeuronPolarity]], read_
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:316
↓ 1 callers
Method
get_activation_records
( self, normalize: bool = False, mask_opposite_sign: bool = False, add_ranks: bool = False )
lib/explanations/explanations/explanations.py:310
↓ 1 callers
Method
get_activations_and_logits
( self, input_ids: torch.Tensor, attention_mask: torch.Tensor, read_modules: M
project/latentqa/latentqa/model_wrapper.py:469
↓ 1 callers
Method
get_all_examples
Returns all examples in a fixed order.
lib/explanations/explanations/explanation_utils.py:254
↓ 1 callers
Function
get_all_mc_option_keys
Get all possible MC option keys for the given number of options. Used for sampling random incorrect answers or validating MC responses.
project/latentqa/latentqa/mc_util.py:235
↓ 1 callers
Method
get_all_system_prompts
( system_prompt_db_dir: str, split: Literal["train", "test"] | None = None, system_pro
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:360
↓ 1 callers
Method
get_all_user_prompts
( user_prompt_db_dir: str, user_prompt_type: Literal["faith_result", "user_prompt"], s
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:317
↓ 1 callers
Function
get_answers
(attr: UserAttribute)
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:578
↓ 1 callers
Function
get_anthropic_chat_completions_async
( client: AsyncAnthropic, messages_list: list[list[ChatMessage]], model_name: str, max_new_tok
lib/util/util/anthropic.py:65
↓ 1 callers
Function
get_anthropic_chat_completions_parallel
( client: AsyncAnthropic, messages_list: list[list[ChatMessage]], model_name: str, max_new_tok
lib/util/util/anthropic.py:119
↓ 1 callers
Function
get_anthropic_client_async
()
lib/util/util/anthropic.py:59
↓ 1 callers
Function
get_attr_classes_for_dataset
(dataset_name: str)
project/latentqa/latentqa/blogpost.py:102
↓ 1 callers
Method
get_attribution
( self, target_token_idx: int, target_token_id: int | None = None, distractor_
lib/neurondb/neurondb/view.py:164
↓ 1 callers
Method
get_attribution_filters
Get a list of all AttributionFilters in this filter and its subfilters.
lib/neurondb/neurondb/filters.py:170
↓ 1 callers
Method
get_chat_completions
( self, messages_list: List[List[ChatMessage]], num_samples: int = 1 )
lib/explanations/explanations/explainer.py:23
↓ 1 callers
Method
get_chat_prefix
(self)
lib/activations/activations/dataset.py:101
↓ 1 callers
Method
get_completion
(self)
project/user_modeling/user_modeling/synthsys/subject_inputs.py:50
↓ 1 callers
Method
get_completions
( self, messages_list: list[list[ChatMessage]], model_category: str, max_new_t
lib/util/util/prod_llms.py:55
↓ 1 callers
Function
get_decoder_base_conversation_and_patch_range
( format: str | Literal["default", "act_in_sys", "act_in_user"], num_patch_tokens: int, question:
project/latentqa/latentqa/decoder_input_util.py:44
↓ 1 callers
Method
get_decoder_portion_of_example
(self, num_patch_tokens: int, qa: QA)
project/latentqa/latentqa/data_util.py:425
↓ 1 callers
Method
get_dummy_datapoint
(self)
project/latentqa/latentqa/eval/steering_util.py:129
↓ 1 callers
Method
get_eval_inputs
(self)
project/user_modeling/user_modeling/belief_eval.py:1114
↓ 1 callers
Function
get_explainer
( model_name: str, max_new_tokens: int, temperature: float = 1.0, top_p: float = 1.0, add_
lib/explanations/explanations/explainer.py:121
↓ 1 callers
Function
get_explainer_prompt_for_one_act_sign
( act_recs: List[ActivationRecord], activation_percentiles: Dict[float, float], sign: ActivationSi
lib/explanations/explanations/explanation_utils.py:126
↓ 1 callers
Method
get_flattened_input_dicts_and_indices
( self, eval_inputs: list[BeliefEvalInput] )
project/user_modeling/user_modeling/belief_eval.py:922
↓ 1 callers
Function
get_full_self_description_df
(stereotypes_path: str)
project/user_modeling/user_modeling/self_describe.py:235
↓ 1 callers
Function
get_huggingface_model_and_tokenizer
( hf_model_id: str, device_map: str = "auto" )
lib/util/util/huggingface.py:34
↓ 1 callers
Method
get_input_dicts
(self, eval_inputs: list[BeliefEvalInput])
project/user_modeling/user_modeling/belief_eval.py:751
↓ 1 callers
Function
get_intervention_hook_by_layer
(layer: int)
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:265
↓ 1 callers
Method
get_layer_act_percs
Computes the activation quantile information for a layer using top-activating sequences from the train, valid, and test splits.
lib/activations/activations/exemplars_wrapper.py:600
↓ 1 callers
Method
get_logits
(self, input_ids: torch.Tensor)
lib/explanations/explanations/simulation_utils.py:406
↓ 1 callers
Method
get_mean_logprobs
(self)
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:62
↓ 1 callers
Method
get_mean_probs
(self)
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:66
↓ 1 callers
Method
get_most_recent_checkpoint
(self)
project/latentqa/latentqa/train_util.py:241
↓ 1 callers
Method
get_neuron_act_percs
( self, top_acts: Dict[ExemplarSplit, Dict[ExemplarType, NDFloatArray]], num_tokens_se
lib/activations/activations/exemplars_wrapper.py:648
↓ 1 callers
Method
get_neuron_exemplars_for_explanation_generation
( self, layer: int, neuron_idx: int, act_sign: ActivationSign )
lib/explanations/explanations/explanations_wrapper.py:179
↓ 1 callers
Function
get_neuron_interventions
( neurons: list[tuple[int, int, NeuronPolarity]], token_ranges: list[tuple[int, int]], percentiles
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:209
↓ 1 callers
Method
get_neurons
TODO perform some sorting
lib/neurondb/neurondb/view.py:249
↓ 1 callers
Function
get_neurons_from_exp_path
(exp_path: str)
lib/explanations/explanations/explanations_wrapper.py:723
↓ 1 callers
Function
get_next_user_prompt_batch
()
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:696
↓ 1 callers
Function
get_openai_chat_completions_async
( client: AsyncOpenAI, messages_list: list[list[ChatMessage]], model_name: str, max_new_tokens
lib/util/util/openai.py:64
↓ 1 callers
Function
get_openai_chat_completions_parallel
Synchronously get chat completions for multiple message lists using parallel processing with asyncio. This function runs the async code in a
lib/util/util/openai.py:106
↓ 1 callers
Function
get_openai_client_sync
()
lib/util/util/openai.py:52
↓ 1 callers
Function
get_openai_embeddings_sync
Synchronously get embeddings for a list of texts using OpenAI's embedding model. This function uses tiktoken for tokenization and truncates a
lib/util/util/openai.py:217
↓ 1 callers
Method
get_pretty_print_tokens_str
(self, subject: "Subject")
lib/util/util/chat_input.py:63
↓ 1 callers
Function
get_prism_eval_data
( hf_model_id: str, mc_stems_by_attr_class: dict[Type[UserAttribute], list[str]], rng: np.random.G
project/latentqa/scripts/prepare_lqa_datasets.py:264
↓ 1 callers
Function
get_prompt_formatter
(system_prompt_type: str, **kwargs: Any)
lib/explanations/explanations/explanation_utils.py:613
↓ 1 callers
Function
get_reading_hook_by_layer
(key: LayerModuleKey)
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:280
↓ 1 callers
Function
get_selfdescribe_eval_data
( hf_model_id: str, mc_stems_by_attr_class: dict[Type[UserAttribute], list[str]], rng: np.random.G
project/latentqa/scripts/prepare_lqa_datasets.py:230
↓ 1 callers
Method
get_seq
(full_document: List[int], seq_len: int)
lib/activations/activations/dataset.py:164
↓ 1 callers
Function
get_simulation_prompt
Returns the part of the simulation prompt that depends on the explanation and sequence.
lib/explanations/explanations/simulation_utils.py:168
↓ 1 callers
Function
get_simulation_prompt_prefix
Returns the system prompt and few-shot example part of the simulation prompt.
lib/explanations/explanations/simulation_utils.py:118
↓ 1 callers
Function
get_single_streaming_callback
( batch_index: int, streaming_callback: AsyncStreamingCallback, )
lib/llm_util/llm_util/types.py:438
↓ 1 callers
Method
get_split_neuron_exemplars
( self, to_score: bool, split: ExemplarSplit, layer: int, neuron_idx:
lib/explanations/explanations/explanations_wrapper.py:163
← previous
next →
301–400 of 1,028, ranked by callers