Skip to content

Commit

Permalink
refactor: make more datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
dtch1997 committed May 6, 2024
1 parent f6203c5 commit 78f9bc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions repepo/experiments/persona_generalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
)
from repepo.steering.utils.helpers import make_dataset
from steering_vectors import train_steering_vector
from repepo.data.multiple_choice.make_mwe_xrisk import make_mwe
from repepo.data.multiple_choice.make_mwe_xrisk import make_mwe as make_mwe_xrisk_caa
from repepo.data.multiple_choice.make_mwe_persona import make_mwe_personas_caa
from repepo.data.multiple_choice.make_caa_sycophancy import make_sycophancy_caa
from repepo.data.multiple_choice.make_caa_truthfulqa import make_truthfulqa_caa
from repepo.utils.stats import bernoulli_js_dist
from repepo.experiments.persona_prompts import get_all_persona_prompts

Expand Down Expand Up @@ -384,14 +386,18 @@ class PersonaGeneralizationExperimentConfig:
default_factory=lambda: [-1.5, -1.0, -0.5, 0.5, 1.0, 1.5]
)

def make_all_datasets():
make_sycophancy_caa()
make_truthfulqa_caa()
make_mwe_xrisk_caa()
make_mwe_personas_caa()

def run_persona_generalization_experiment(
config: PersonaGeneralizationExperimentConfig,
sge_task_id: int | None = None,
) -> None:
print(f"Running persona generalization experiment with config: {config}")
make_mwe_personas_caa()
make_mwe()
make_all_datasets()
model = AutoModelForCausalLM.from_pretrained(
config.model_name, torch_dtype=torch.float16, device_map=0
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/persona_generalization.qsub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#$ -ac allow=L # Specify the type of GPU
#$ -o $HOME/logs
#$ -e $HOME/logs
#$ -t 1-100
#$ -t 1-116

# Add locally installed executables to PATH
source /home/$USER/.bash_profile
Expand Down

0 comments on commit 78f9bc4

Please sign in to comment.