Skip to content

Commit df828a0

Browse files
Merge pull request sherdencooper#10 from sherdencooper/hubert
rename
2 parents d254887 + 151a1ae commit df828a0

15 files changed

Lines changed: 132 additions & 461 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Results/*
1919
save_example_rep.py
2020
save_rep.py
2121
convert.py
22-
LLM_MMR/Attack_ICA/ica_quick_test.py
23-
LLM_MMR/utils/get_templates.py
22+
BOOST/Attack_ICA/ica_quick_test.py
23+
BOOST/utils/get_templates.py
2424
compare_rep.py
2525
read_rep.py
2626
test_fuzzer.py

Dataset/GPTFuzzer.csv

Lines changed: 0 additions & 431 deletions
This file was deleted.

Experiments/fuzzer_exp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import sys
22
import os
33

4-
# Add the path to the LLM_MMR folder to sys.path
5-
sys.path.append(os.path.abspath('../LLM_MMR'))
4+
# Add the path to the BOOST folder to sys.path
5+
sys.path.append(os.path.abspath('../BOOST'))
66
import argparse
7-
from LLM_MMR.Attack_GPTFuzzer.gptfuzz import fuzzer_attack
7+
from BOOST.Attack_GPTFuzzer.gptfuzz import fuzzer_attack
88
from fastchat.model import add_model_args
9-
from LLM_MMR.utils.constants import openai_key, claude_key, gemini_key
9+
from BOOST.utils.constants import openai_key, claude_key, gemini_key
1010

1111

1212
if __name__ == "__main__":

Experiments/gcg_exp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import sys
22
import os
33

4-
# Add the path to the LLM_MMR folder to sys.path
5-
sys.path.append(os.path.abspath('../LLM_MMR'))
6-
from LLM_MMR.Attack_GCG.run_gcg import gcg_attack
4+
# Add the path to the BOOST folder to sys.path
5+
sys.path.append(os.path.abspath('../BOOST'))
6+
from BOOST.Attack_GCG.run_gcg import gcg_attack
77
import argparse
88

99
if __name__ == "__main__":

Experiments/ica_exp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import sys
22
import os
33

4-
# Add the path to the LLM_MMR folder to sys.path
5-
sys.path.append(os.path.abspath('../LLM_MMR'))
4+
# Add the path to the BOOST folder to sys.path
5+
sys.path.append(os.path.abspath('../BOOST'))
66
import argparse
7-
from LLM_MMR.Attack_ICA.ica import ICA_attack
7+
from BOOST.Attack_ICA.ica import ICA_attack
88
from fastchat.model import add_model_args
9-
from LLM_MMR.utils.constants import openai_key, claude_key, gemini_key
9+
from BOOST.utils.constants import openai_key, claude_key, gemini_key
1010

1111

1212
if __name__ == "__main__":

Experiments/sure_exp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import sys
22
import os
33

4-
# Add the path to the LLM_MMR folder to sys.path
5-
sys.path.append(os.path.abspath('../LLM_MMR'))
4+
# Add the path to the BOOST folder to sys.path
5+
sys.path.append(os.path.abspath('../BOOST'))
66
import argparse
7-
from LLM_MMR.Attack_ICA.sure import SURE_attack
7+
from BOOST.Attack_ICA.sure import SURE_attack
88
from fastchat.model import add_model_args
9-
from LLM_MMR.utils.constants import openai_key, claude_key, gemini_key
9+
from BOOST.utils.constants import openai_key, claude_key, gemini_key
1010

1111

1212
if __name__ == "__main__":

LLM_MMR/Attack_GCG/gcg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from transformers import (AutoModelForCausalLM, AutoTokenizer, GPT2LMHeadModel,
1010
GPTJForCausalLM, GPTNeoXForCausalLM,
1111
LlamaForCausalLM)
12-
from LLM_MMR.Attack_GCG.gcg_utils import get_nonascii_toks, verify_input, get_embedding_weight, get_embeddings, get_fixed_list, chatgpt_evaluate
13-
from LLM_MMR.utils.templates import get_templates, get_end_tokens, get_eos
14-
from LLM_MMR.utils.constants import get_black_list
12+
from BOOST.Attack_GCG.gcg_utils import get_nonascii_toks, verify_input, get_embedding_weight, get_embeddings, get_fixed_list, chatgpt_evaluate
13+
from BOOST.utils.templates import get_templates, get_end_tokens, get_eos
14+
from BOOST.utils.constants import get_black_list
1515

1616
def token_gradients(model, input_ids, target_tokens, input_slice, loss_slice):
1717

LLM_MMR/Attack_GCG/gcg_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
LlamaForCausalLM, MptForCausalLM, Qwen2ForCausalLM,
55
GemmaForCausalLM, MistralForCausalLM)
66
from openai import OpenAI
7-
from LLM_MMR.utils.constants import openai_key
7+
from BOOST.utils.constants import openai_key
88
client = OpenAI(api_key = openai_key)
99
import time
1010

LLM_MMR/Attack_GCG/run_gcg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# os.environ['CUDA_VISIBLE_DEVICES'] = '0' # for debugging
33
import pandas as pd
44
import argparse
5-
from LLM_MMR.Attack_GCG.gcg import GCG
5+
from BOOST.Attack_GCG.gcg import GCG
66
import csv
7-
from LLM_MMR.utils.templates import get_eos
7+
from BOOST.utils.templates import get_eos
88

99
def gcg_attack(args):
1010

LLM_MMR/Attack_GPTFuzzer/gptfuzz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from gptfuzzer.llm import OpenAILLM, LocalVLLM, LocalLLM, ClaudeLLM, GeminiLLM
1313
from gptfuzzer.utils.predict import RoBERTaPredictor
1414
import random
15-
from LLM_MMR.utils.templates import get_eos
15+
from BOOST.utils.templates import get_eos
1616
random.seed(100)
1717
import logging
1818

0 commit comments

Comments
 (0)