MCPcopy Create free account

hub / github.com/TransluceAI/observatory / functions

Functions1,028 in github.com/TransluceAI/observatory

↓ 3 callersFunctionget_label
(base_label: str, label_delimiter: str)
project/latentqa/latentqa/mc_util.py:139
↓ 3 callersMethodget_matching_ids
(self, db: DBManager)
lib/neurondb/neurondb/filters.py:223
↓ 3 callersMethodget_neurons
(self)
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:203
↓ 3 callersMethodget_neurons_metadata_dict
( self, neurons: list[Neuron], include_run_metadata: bool = False )
lib/neurondb/neurondb/view.py:293
↓ 3 callersMethodget_normalized_act_records
( self, exemplar_split: ExemplarSplit, mask_opposite_sign: bool = False )
lib/activations/activations/exemplars.py:61
↓ 3 callersFunctionget_nv
Convert the saved session state into a NeuronView. May be slow because the NeuronView constructor recomputes activations.
project/monitor/monitor/server.py:128
↓ 3 callersFunctionhandlePresetFlowClick
(presetFlowId?: string)
project/monitor/web/app/dashboard/chat/components/LinterPanel.tsx:336
↓ 3 callersMethodinsert
(self, obj: T, time_str: str)
project/user_modeling/user_modeling/db_wrapper.py:262
↓ 3 callersMethodkey
(self)
project/latentqa/latentqa/eval/steering_util.py:138
↓ 3 callersMethodload_percentiles
( db: DBManager, subject: Subject, percentiles: list[QTILE_KEYS_TYPE] )
lib/neurondb/neurondb/view.py:85
↓ 3 callersMethodload_results
( self, eval_type: Literal["reading", "control"] )
project/latentqa/latentqa/eval/circuit_based_steering_eval.py:185
↓ 3 callersMethodload_results
( self, eval_type: Literal["reading", "control"] )
project/latentqa/latentqa/eval/steering_eval.py:801
↓ 3 callersFunctionmake_chat_conversation
(system_prompt: str | None = None)
lib/util/util/chat_input.py:342
↓ 3 callersMethodnum_tokens
(self)
lib/neurondb/neurondb/view.py:116
↓ 3 callersFunctionprocess_tokens
( tokens: List[tuple[str, ActivationSign | None]] )
lib/explanations/explanations/explanation_utils.py:52
↓ 3 callersFunctionresetNeuronModulation
()
project/monitor/web/app/dashboard/chat/components/ChatArea.tsx:141
↓ 3 callersFunctionsave_random_seqs_for_layer
( exemplars_wrapper: ExemplarsWrapper, layer: int, split: ExemplarSplit, )
lib/activations/activations/exemplars_computation.py:444
↓ 3 callersFunctionscore_from_simulation
( real_activations: List[float], simulation: SequenceSimulation, score_function: Callable[[List[fl
lib/explanations/explanations/scoring_utils.py:119
↓ 3 callersFunctionsetFlowState
(state, action: PayloadAction<FlowState | undefined>)
project/monitor/web/app/store/slices/uiStateSlice.ts:45
↓ 3 callersFunctionsetLoadingTokenSelectionLinterMessageId
(state, action: PayloadAction<string | undefined>)
project/monitor/web/app/store/slices/aiLinterSlice.ts:91
↓ 3 callersFunctionsetMousedOverNeurons
(state, action: PayloadAction<Neuron[] | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:70
↓ 3 callersMethodslice
Slice the activations by the given start and end indices
project/latentqa/latentqa/model_wrapper.py:125
↓ 3 callersMethodstep
(self)
project/latentqa/latentqa/train_util.py:75
↓ 3 callersFunctionupdateLinterMessage
(state, action: PayloadAction<{ id: string, message: LinterMessage }>)
project/monitor/web/app/store/slices/aiLinterSlice.ts:100
↓ 3 callersMethodupdate_input
Convert special tokens to their updated versions.
lib/explanations/explanations/llama_model.py:64
↓ 2 callersMethod__init__
(self, data: Optional[dict[LayerModuleKey, torch.Tensor]] = None, **kwargs)
project/latentqa/latentqa/model_wrapper.py:109
↓ 2 callersFunction_build_response_format
( response_format: ResponseFormat | None, )
lib/llm_util/llm_util/openai.py:156
↓ 2 callersFunction_build_thinking_args
Build the thinking/effort kwargs for the Anthropic messages.create call.
lib/llm_util/llm_util/anthropic.py:206
↓ 2 callersFunction_cache_responses
()
lib/llm_util/llm_util/prod_llms.py:181
↓ 2 callersMethod_execute_with_intervention
Helper method to execute model with activation interventions.
project/latentqa/latentqa/model_wrapper.py:528
↓ 2 callersFunction_get_finish_reason
(i: int)
lib/llm_util/llm_util/openai.py:258
↓ 2 callersMethod_get_generation_prompt
Get the generation prompt for a given attribute class
project/latentqa/latentqa/qas.py:165
↓ 2 callersFunction_get_text
(i: int)
lib/llm_util/llm_util/openai.py:247
↓ 2 callersFunction_parse_chat_messages
(messages: list[ChatMessage])
lib/llm_util/llm_util/openai.py:81
↓ 2 callersFunction_parse_chat_messages
(messages: list[ChatMessage])
lib/llm_util/llm_util/anthropic.py:79
↓ 2 callersMethod_parse_generation_response_for_general
Parse the LLM's generation response into QA objects, matching the expected template format.
project/latentqa/latentqa/qas.py:187
↓ 2 callersMethod_parse_generation_response_for_multiple_choice
Parse the LLM's generation response into QA objects, matching the expected template format.
project/latentqa/latentqa/qas.py:243
↓ 2 callersFunction_parse_message_content
(content: str | list[Content])
lib/llm_util/llm_util/anthropic.py:66
↓ 2 callersFunction_parse_tool_choice
(tool_choice: Literal["auto", "required"] | None)
lib/llm_util/llm_util/anthropic.py:187
↓ 2 callersFunction_parse_tools
(tools: list[ToolInfo])
lib/llm_util/llm_util/openai.py:142
↓ 2 callersFunction_parse_tools
(tools: list[ToolInfo])
lib/llm_util/llm_util/anthropic.py:176
↓ 2 callersMethod_save_config
(self, config: BaseModel | dict[str, Any], batch_time: str)
project/user_modeling/user_modeling/db_wrapper.py:149
↓ 2 callersFunctionaddToRemoveQueue
(toastId: string)
project/monitor/web/hooks/use-toast.ts:61
↓ 2 callersFunctionadd_brackets
If there are spaces within tokens, push them outside the brackets.
lib/explanations/explanations/explanation_utils.py:29
↓ 2 callersFunctionaggregate_scored_sequence_simulations
Aggregate a list of scored sequence simulations. The logic for doing this is non-trivial for EV scores, since we want to calculate the correl
lib/explanations/explanations/explanations.py:337
↓ 2 callersFunctionapply_calibration
( values: List[float], regression_model: linear_model.LinearRegression )
lib/explanations/explanations/scoring_utils.py:127
↓ 2 callersFunctionapproximate_quantile
Approximate the q-quantile for each batch, given the bottom k and top k values. Parameters: - q: The desired quantile (cumulative probab
lib/activations/activations/exemplars_wrapper.py:248
↓ 2 callersMethodbatch_size
Get the batch size (validates consistency across all lists)
project/latentqa/latentqa/model_wrapper.py:244
↓ 2 callersMethodbatch_slice
Convenience method for batch slicing with the pattern start_idx : end_idx Args: batch_idx: The batch index to slice
project/latentqa/latentqa/model_wrapper.py:314
↓ 2 callersFunctioncalculate_max_activation
(activation_records: Sequence[ActivationRecord])
lib/activations/activations/activations.py:29
↓ 2 callersFunctioncalibrate_and_score_simulation
( simulation: SequenceSimulation, activations: List[float], regression_model: linear_model.LinearR
lib/explanations/explanations/scoring_utils.py:153
↓ 2 callersMethodcollect_acts
Collect activations for the given layers, only including the given keys.
lib/util/util/subject.py:255
↓ 2 callersFunctioncollect_completions_and_probs
Collect completions and compute mean probability scores from eval results. Takes a list of eval results for a single subject input (same key) and
project/user_modeling/user_modeling/synthsys/subject_inputs.py:189
↓ 2 callersFunctioncompute_loss
( batch: LQABatch, subject: ModelWrapper, decoder: ModelWrapper, read_modules: Modules, wr
project/latentqa/latentqa/train_util.py:684
↓ 2 callersFunctioncompute_predicted_activation_stats_for_token
( vocab_logprobs: NDFloatArray, )
lib/explanations/explanations/simulation_utils.py:261
↓ 2 callersFunctionconstruct_mc_options_for_train
Construct multiple choice options for training data. More flexible than construct_mc_options_for_eval, supporting various label types (l
project/latentqa/latentqa/mc_util.py:267
↓ 2 callersMethodcontains_filter_type
Check if this filter contains a filter of the specified type.
lib/neurondb/neurondb/filters.py:160
↓ 2 callersMethoddelete
(self, row_id: int)
project/user_modeling/user_modeling/db_wrapper.py:224
↓ 2 callersMethoddivide
(self, factor: float)
lib/llm_util/llm_util/types.py:255
↓ 2 callersFunctiondo_logprob_eval
( data: list[LQAData], hf_model_id: str, subject: ModelWrapper, decoder: ModelWrapper, tok
project/latentqa/latentqa/eval/reading_eval.py:34
↓ 2 callersFunctionevaluate_control
( steering_input: SteeringInput, all_activations: ActivationsList, patch_from_region: PatchFromReg
project/latentqa/latentqa/eval/steering_eval.py:475
↓ 2 callersFunctionevaluate_faithfulness_of_completions
Evaluate faithfulness of completions using LLM judge. Args: eval_inputs: List of FaithfulnessEvalInput objects. completions_
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:108
↓ 2 callersFunctionevaluate_reading_after_steering
( steering_input: SteeringInput, token_range_from: tuple[int, int], all_activations: ActivationsLi
project/latentqa/latentqa/eval/steering_eval.py:415
↓ 2 callersFunctionextract_user_attributes_from_prism_dataset
( survey_row: pd.Series, )
project/user_modeling/user_modeling/prism.py:79
↓ 2 callersFunctionextract_user_prompt_and_context_from_conv
( conversation: list[dict[str, str]], )
project/latentqa/scripts/prepare_lqa_datasets.py:270
↓ 2 callersMethodformat_normalized_act_recs
( self, normalized_act_recs: List[ActivationRecord], explanation: Optional[str] = None )
lib/explanations/explanations/explanation_utils.py:473
↓ 2 callersMethodget_activations
( self, input_ids: torch.Tensor, attention_mask: torch.Tensor, read_modules: M
project/latentqa/latentqa/model_wrapper.py:515
↓ 2 callersMethodget_all_explanations_and_scores
( self, exemplar_splits: Sequence[ExemplarSplit] )
lib/explanations/explanations/explanations.py:284
↓ 2 callersMethodget_all_value_names
Get all possible values with their display names
project/user_modeling/user_modeling/user_attribute.py:48
↓ 2 callersFunctionget_answers
(attr: UserAttribute)
project/latentqa/latentqa/eval/steering_eval.py:972
↓ 2 callersFunctionget_belief_eval_results_from_db
( db_path: str, attr_class: Type[UserAttribute] | None = None, suffix: str = "" )
project/user_modeling/user_modeling/belief_eval.py:1216
↓ 2 callersMethodget_best_idxs
(self, neuron_explanations: NeuronExplanations)
project/expgen/scripts/generate_and_score_explanation.py:34
↓ 2 callersFunctionget_color_str
(act: float, cmap: bool = True)
lib/activations/activations/exemplars_wrapper.py:39
↓ 2 callersMethodget_dataset_for_split
( self, split: Literal["train", "valid", "test"] )
lib/activations/activations/dataset.py:142
↓ 2 callersMethodget_examples
Maybe returns a random sample of examples.
lib/explanations/explanations/explanation_utils.py:258
↓ 2 callersFunctionget_examples_for_fewshot
()
lib/explanations/explanations/few_shot_examples.py:24
↓ 2 callersFunctionget_huggingface_tokenizer
(hf_model_id: str)
lib/util/util/huggingface.py:17
↓ 2 callersMethodget_i
Get the ith sample from the batched tensor for the given key
project/latentqa/latentqa/model_wrapper.py:149
↓ 2 callersMethodget_instance
(cls, db_name: str | None = None)
lib/neurondb/neurondb/postgres.py:43
↓ 2 callersMethodget_layer_dir_for_neuron_level
(self, layer: int, split: ExemplarSplit)
lib/activations/activations/exemplars_wrapper.py:411
↓ 2 callersFunctionget_llm_completions_async
Get LLM completions for a batch of message lists. Args: messages_list: Batch of conversations. Each conversation is a sequence
lib/llm_util/llm_util/prod_llms.py:234
↓ 2 callersFunctionget_lqa_data_from_full_lqa_data_db
( full_lqa_data_db_dir: str | os.PathLike, conditions: dict[str, Any] | None = None, rng: np.rando
project/latentqa/latentqa/lqa_data.py:509
↓ 2 callersMethodget_module_eval_str
(self, key: LayerModuleKey)
project/latentqa/latentqa/model_wrapper.py:429
↓ 2 callersFunctionget_neuron_explanations_file_paths_from_exp_path
Returns a list of paths corresponding to the NeuronExplanations data saved in the experiment directory. If neurons is not None, only the
lib/explanations/explanations/explanations_wrapper.py:483
↓ 2 callersFunctionget_openai_client_async
()
lib/util/util/openai.py:58
↓ 2 callersFunctionget_openai_embeddings_async
Asynchronously get embeddings for a list of texts using OpenAI's embedding model. This function uses tiktoken for tokenization, truncates at
lib/util/util/openai.py:155
↓ 2 callersFunctionget_prism_dataset
()
project/user_modeling/user_modeling/prism.py:28
↓ 2 callersMethodget_steering_qas_for_dataloader
(self, validation: bool = False)
project/latentqa/latentqa/eval/steering_util.py:91
↓ 2 callersFunctionget_synthsys_eval_data
( hf_model_id: str, attr_classes_to_consider: list[Type[UserAttribute]], mc_stems_by_attr_class: d
project/latentqa/scripts/prepare_lqa_datasets.py:154
↓ 2 callersFunctionget_test_mc_qas
( true_attr: UserAttribute, target_attr: UserAttribute, stems_by_attr_class: dict[Type[UserAttribu
project/latentqa/latentqa/eval/steering_util.py:17
↓ 2 callersFunctionget_token_id
(letter: str, with_seed_response)
project/latentqa/latentqa/eval/steering_util.py:235
↓ 2 callersFunctionget_token_id
(letter: str, with_seed_response)
project/latentqa/latentqa/eval/reading_eval.py:334
↓ 2 callersFunctionget_tokenizer
(model_path: str, add_special_tokens: bool = False)
lib/explanations/explanations/llama_model.py:101
↓ 2 callersMethodget_unique_values
(self, column_names: list[str], **conditions: Any)
project/user_modeling/user_modeling/db_wrapper.py:397
↓ 2 callersFunctionget_vllm_chat_completion_async
( client: AsyncOpenAI, messages: list[dict[str, str]], model: str, n: int = 1, max_tokens:
project/user_modeling/user_modeling/llm_util.py:75
↓ 2 callersFunctionget_xs_ys_error
( results_df, tags_by_attr_class: dict[Type[UserAttribute], set[str]], labels_by_tag: dict[str, Us
project/latentqa/latentqa/blogpost.py:252
↓ 2 callersFunctionhandleSteering
(version: 'add' | 'remove')
project/monitor/web/app/dashboard/chat/components/SteeringPanel.tsx:110
↓ 2 callersMethodis_empty
(self, subject: Subject)
lib/util/util/chat_input.py:104
↓ 2 callersMethodis_neuron_explanations_done_scoring
( self, neuron_explanations: NeuronExplanations, exem_splits: Sequence[ExemplarSplit],
lib/explanations/explanations/explanations_wrapper.py:351
↓ 2 callersMethodis_valid
(self, use_mean: bool = False, buffer: float = 0.0)
project/user_modeling/user_modeling/synthsys/subject_inputs.py:53
← previousnext →101–200 of 1,028, ranked by callers