This repository is the official implementation of StreamingDialogue: Prolonged Dialogue Learning via Long Context Compression with Minimal Losses. The code is developed based on LLaMA-Factory.
To install requirements:
pip install -r requirements.txt
To train the model(s) in the paper, run this command:
cd src
./train.sh
./merge.sh
Modify the file /src/llmtuner/train/sft/workflow.py
:
Modify the file /model/llama/modeling_llama.py
:
cd src
./train.sh
./merge.sh
cd src
python generate.py
cd src
python infer.py
evaluate PPL
cd src python eval_ppl.py --base_model /model/strdialogue-merge --eval_path /data/test_msc.json
evaluate various metrics
cd src python compute_score.py
You can download pretrained models here: