รหัสอย่างเป็นทางการสำหรับกระดาษ "การสร้างแบบจำลองภาษาที่รับรู้บริบทสำหรับระบบการสนทนาที่มุ่งเน้นเป้าหมาย"
เว็บไซต์โครงการ | arxiv
conda create --name CALM python=3.9.7conda activate CALMpip install -r requirements.txtconda install pytorch==1.9.0 cudatoolkit=11.3 -c pytorch -c conda-forgeexport PYTHONPATH="$PWD/offline_airdialogue"outputs/ โฟลเดอร์มีจุดตรวจสอบสำหรับรุ่นหลักของเราโมเดลที่ได้รับการฝึกฝนและงานของเราบอทลูกค้าของเรา (หมายเหตุ: การฝึกอบรมทั้งหมดใช้ WANDB โดยค่าเริ่มต้นคุณสามารถปิดการซิงค์ WANDB ในการกำหนดค่า)
cd scripts/train
ในการเรียกใช้การฝึกอบรมแบบ multi-gpu data-parallel บนคำสั่งใด ๆ ด้านล่างแทนที่ python <script_path> ด้วย python -m torch.distributed.launch --nproc_per_node <n_GPUs> --use_env <script_path>
ความสงบเงียบ
(สองสายพันธุ์ของฟังก์ชั่นการสูญเสียเสริม)
สคริปต์: python train_pretrain_table_agent.py
config: config/train_pretrain_table_agent.yaml
สคริปต์: python train_pretrain_simplified_aux_gpt2.py
config: config/train_pretrain_simplified_aux_gpt2.yaml
ฝึกอบรมบอทลูกค้า
python train_customer.pyconfig/train_customer_bot.yaml การฝึกความสงบ
(สองสายพันธุ์ของฟังก์ชั่นการสูญเสียเสริม)
สคริปต์: python train_real_table_agent.py
config: config/train_real_table_agent.yaml
สคริปต์: python train_simplified_aux_gpt2.py
config: config/train_simplified_aux_agent.yaml
มาตรฐานการฝึกอบรม LM
python train_basic_agent.pyconfig/train_basic_agent.yamlการฝึกอบรมแบบจำลองรางวัลสำหรับการวางแผนการเปิดตัวแบบจำลอง
python train_constraint_parser.pyconfig/train_constraint_parser.yaml cd scripts/eval
การประเมินแบบจำลอง
python selfplay_eval.pyconfig/selfplay_eval.yamlselfplay/outputs_file ในการกำหนดค่า ในการพิมพ์อัตราความสำเร็จสำหรับการวิ่งด้วยตนเอง: python compute_results.py --results_file <your_eval_outputs_file>CUDA_VISIBLE_DEVICES=<comma_seperated_list_of_gpu_indicies>การประเมินคุณภาพภาษา
python language_quality_eval.pyconfig/language_eval.yamlpython -m torch.distributed.launch --nproc_per_node <n_GPUs> --use_env language_quality_eval.py