This repository contains the official code for the paper "BTAgent: Large Language Model for Behavior Tree Generation with Constrained DPO".
python3 generate_instruction_bt.py generate_instruction_following_data
The generated data is in json format where each data contains the following attributes:
{
"chosen": [{"role": "user", "content": <prompt>},
{"role": "assistant", "content": <chosen bt>}],
"rejected": [{"role": "user", "content": <prompt>},
{"role": "assistant", "content": <rejected bt>}]
}
Example. The following code generates 800 synthetic data for iteration 0.
bash scripts/generate.sh
accelerate launch --config_file configs/deepspeed_zero3.yaml bt_lora.py configs/config.yaml --num_train_epochs=6
You might need to change the configuration in configs/config.yaml.
Example.
bash scripts/finetune.sh