data/poison_long_trigger_llama2.jsonl
pip install -r requirements.txt
CUDA_VISIBLE_DEVICES=<your device id> python backdoor.py
python generate.py --device <your device id>
We also provide a pre-trained backdoor model, which users can directly utilize for generation:
python generate_pretrained.py --device <your device id>
python auto_eval.py --model gpt-4 --key <OpenAI API Key>
python upload.py --device <your device id>
CUDA_VISIBLE_DEVICES=<your device id> python realign.py --model_name <backdoor model name>
Then, you can reuse generate.py
and change model_name
, new_model
, and res_path
accordinglly to perform generation.