pyvene.models.qwen2.modelings_intervenable_qwen2

pyvene.models.qwen2.modelings_intervenable_qwen2#

Each modeling file in this library is a mapping between abstract naming of intervention anchor points and actual model module defined in the huggingface library. We also want to let the intervention library know how to config the dimensions of intervention based on model config defined in the huggingface library.

Module Attributes

qwen2_type_to_dimension_mapping

qwen2 model with LM head

qwen2_lm_type_to_dimension_mapping

qwen2 model with classifier head

Functions

create_qwen2([name, cache_dir, dtype])

Creates a Causal LM model, config, and tokenizer from the given name and revision