├── LICENSE ├── LLaMA-Factory ├── .gitattributes ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── README_zh.md ├── assets │ ├── benchmark.svg │ ├── logo.png │ └── wechat.jpg ├── evaluation │ └── mmlu │ │ ├── mapping.json │ │ ├── mmlu.py │ │ └── mmlu.zip ├── pyproject.toml ├── requirements.txt ├── setup.py ├── src │ ├── api_demo.py │ ├── cli_demo.py │ ├── evaluate.py │ ├── export_model.py │ ├── llmtuner │ │ ├── __init__.py │ │ ├── api │ │ │ ├── __init__.py │ │ │ ├── app.py │ │ │ └── protocol.py │ │ ├── chat │ │ │ ├── __init__.py │ │ │ └── chat_model.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── loader.py │ │ │ ├── preprocess.py │ │ │ ├── sampler.py │ │ │ ├── template.py │ │ │ └── utils.py │ │ ├── eval │ │ │ ├── __init__.py │ │ │ ├── evaluator.py │ │ │ └── template.py │ │ ├── extras │ │ │ ├── __init__.py │ │ │ ├── callbacks.py │ │ │ ├── constants.py │ │ │ ├── logging.py │ │ │ ├── misc.py │ │ │ ├── packages.py │ │ │ ├── patches │ │ │ │ ├── __init__.py │ │ │ │ └── llama_patch.py │ │ │ └── ploting.py │ │ ├── hparams │ │ │ ├── __init__.py │ │ │ ├── data_args.py │ │ │ ├── evaluation_args.py │ │ │ ├── finetuning_args.py │ │ │ ├── generating_args.py │ │ │ └── model_args.py │ │ ├── model │ │ │ ├── __init__.py │ │ │ ├── adapter.py │ │ │ ├── loader.py │ │ │ ├── parser.py │ │ │ ├── patcher.py │ │ │ └── utils.py │ │ ├── train │ │ │ ├── __init__.py │ │ │ ├── dpo │ │ │ │ ├── __init__.py │ │ │ │ ├── collator.py │ │ │ │ ├── trainer.py │ │ │ │ └── workflow.py │ │ │ ├── ppo │ │ │ │ ├── __init__.py │ │ │ │ ├── trainer.py │ │ │ │ ├── utils.py │ │ │ │ └── workflow.py │ │ │ ├── pt │ │ │ │ ├── __init__.py │ │ │ │ └── workflow.py │ │ │ ├── rm │ │ │ │ ├── __init__.py │ │ │ │ ├── collator.py │ │ │ │ ├── metric.py │ │ │ │ ├── trainer.py │ │ │ │ └── workflow.py │ │ │ ├── sft │ │ │ │ ├── __init__.py │ │ │ │ ├── metric.py │ │ │ │ ├── trainer.py │ │ │ │ └── workflow.py │ │ │ ├── tuner.py │ │ │ └── utils.py │ │ └── webui │ │ │ ├── __init__.py │ │ │ ├── chatter.py │ │ │ ├── common.py │ │ │ ├── components │ │ │ ├── __init__.py │ │ │ ├── chatbot.py │ │ │ ├── data.py │ │ │ ├── eval.py │ │ │ ├── export.py │ │ │ ├── infer.py │ │ │ ├── top.py │ │ │ └── train.py │ │ │ ├── css.py │ │ │ ├── engine.py │ │ │ ├── interface.py │ │ │ ├── locales.py │ │ │ ├── manager.py │ │ │ ├── runner.py │ │ │ └── utils.py │ ├── train_bash.py │ ├── train_web.py │ └── web_demo.py └── tests │ ├── cal_flops.py │ ├── cal_lr.py │ ├── llamafy_baichuan2.py │ ├── llamafy_qwen.py │ ├── loftq_init.py │ └── quantize.py ├── README.md ├── assets ├── SelfContrastIntro4.pdf └── SelfContrastIntro4.png ├── config └── ds_config_zero2.json ├── data ├── README.md ├── README_zh.md └── dataset_info.json ├── requirements.txt ├── scripts ├── HH-RLHF │ ├── All_In_One.sh │ ├── DPO.sh │ ├── SFT.sh │ ├── SPIN.sh │ ├── Self-Contrast_1.sh │ ├── Self-Contrast_16.sh │ ├── Self-Contrast_2.sh │ ├── Self-Contrast_4.sh │ ├── Self-Contrast_8.sh │ └── Test.sh ├── Nectar │ ├── DPO.sh │ ├── SFT.sh │ ├── SPIN.sh │ ├── Self-Contrast_1.sh │ ├── Self-Contrast_16.sh │ ├── Self-Contrast_2.sh │ ├── Self-Contrast_4.sh │ └── Self-Contrast_8.sh └── UltraChat │ ├── DPO.sh │ ├── SPIN.sh │ ├── Self-Contrast_1.sh │ ├── Self-Contrast_16.sh │ ├── Self-Contrast_2.sh │ ├── Self-Contrast_4.sh │ └── Self-Contrast_8.sh └── src ├── compute_embeddings.py ├── compute_output_reward.py ├── compute_winrate.py ├── construct_synthetic_data.py ├── draw_figures.py ├── inference.py ├── inference_valid.py └── utils.py /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LICENSE -------------------------------------------------------------------------------- /LLaMA-Factory/.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/.gitattributes -------------------------------------------------------------------------------- /LLaMA-Factory/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/.gitignore -------------------------------------------------------------------------------- /LLaMA-Factory/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /LLaMA-Factory/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/LICENSE -------------------------------------------------------------------------------- /LLaMA-Factory/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/README.md -------------------------------------------------------------------------------- /LLaMA-Factory/README_zh.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/README_zh.md -------------------------------------------------------------------------------- /LLaMA-Factory/assets/benchmark.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/assets/benchmark.svg -------------------------------------------------------------------------------- /LLaMA-Factory/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/assets/logo.png -------------------------------------------------------------------------------- /LLaMA-Factory/assets/wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/assets/wechat.jpg -------------------------------------------------------------------------------- /LLaMA-Factory/evaluation/mmlu/mapping.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/evaluation/mmlu/mapping.json -------------------------------------------------------------------------------- /LLaMA-Factory/evaluation/mmlu/mmlu.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/evaluation/mmlu/mmlu.py -------------------------------------------------------------------------------- /LLaMA-Factory/evaluation/mmlu/mmlu.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/evaluation/mmlu/mmlu.zip -------------------------------------------------------------------------------- /LLaMA-Factory/pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/pyproject.toml -------------------------------------------------------------------------------- /LLaMA-Factory/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/requirements.txt -------------------------------------------------------------------------------- /LLaMA-Factory/setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/setup.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/api_demo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/api_demo.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/cli_demo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/cli_demo.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/evaluate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/evaluate.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/export_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/export_model.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/api/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/api/app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/api/app.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/api/protocol.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/api/protocol.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/chat/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/chat/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/chat/chat_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/chat/chat_model.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/loader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/loader.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/preprocess.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/preprocess.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/sampler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/sampler.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/template.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/template.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/data/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/data/utils.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/eval/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/eval/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/eval/evaluator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/eval/evaluator.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/eval/template.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/eval/template.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/callbacks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/callbacks.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/constants.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/constants.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/logging.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/logging.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/misc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/misc.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/packages.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/packages.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/patches/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/patches/llama_patch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/patches/llama_patch.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/extras/ploting.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/extras/ploting.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/data_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/data_args.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/evaluation_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/evaluation_args.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/finetuning_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/finetuning_args.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/generating_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/generating_args.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/hparams/model_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/hparams/model_args.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/adapter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/adapter.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/loader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/loader.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/parser.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/patcher.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/patcher.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/model/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/model/utils.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/dpo/__init__.py: -------------------------------------------------------------------------------- 1 | from llmtuner.train.dpo.workflow import run_dpo 2 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/dpo/collator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/dpo/collator.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/dpo/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/dpo/trainer.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/dpo/workflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/dpo/workflow.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/ppo/__init__.py: -------------------------------------------------------------------------------- 1 | from llmtuner.train.ppo.workflow import run_ppo 2 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/ppo/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/ppo/trainer.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/ppo/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/ppo/utils.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/ppo/workflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/ppo/workflow.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/pt/__init__.py: -------------------------------------------------------------------------------- 1 | from llmtuner.train.pt.workflow import run_pt 2 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/pt/workflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/pt/workflow.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/rm/__init__.py: -------------------------------------------------------------------------------- 1 | from llmtuner.train.rm.workflow import run_rm 2 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/rm/collator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/rm/collator.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/rm/metric.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/rm/metric.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/rm/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/rm/trainer.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/rm/workflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/rm/workflow.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/sft/__init__.py: -------------------------------------------------------------------------------- 1 | from llmtuner.train.sft.workflow import run_sft 2 | -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/sft/metric.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/sft/metric.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/sft/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/sft/trainer.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/sft/workflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/sft/workflow.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/tuner.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/tuner.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/train/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/train/utils.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/chatter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/chatter.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/common.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/common.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/__init__.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/chatbot.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/chatbot.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/data.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/eval.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/export.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/export.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/infer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/infer.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/top.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/top.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/components/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/components/train.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/css.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/css.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/engine.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/engine.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/interface.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/interface.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/locales.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/locales.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/manager.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/manager.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/runner.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/runner.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/llmtuner/webui/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/llmtuner/webui/utils.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/train_bash.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/train_bash.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/train_web.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/train_web.py -------------------------------------------------------------------------------- /LLaMA-Factory/src/web_demo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/src/web_demo.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/cal_flops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/cal_flops.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/cal_lr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/cal_lr.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/llamafy_baichuan2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/llamafy_baichuan2.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/llamafy_qwen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/llamafy_qwen.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/loftq_init.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/loftq_init.py -------------------------------------------------------------------------------- /LLaMA-Factory/tests/quantize.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/LLaMA-Factory/tests/quantize.py -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/README.md -------------------------------------------------------------------------------- /assets/SelfContrastIntro4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/assets/SelfContrastIntro4.pdf -------------------------------------------------------------------------------- /assets/SelfContrastIntro4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/assets/SelfContrastIntro4.png -------------------------------------------------------------------------------- /config/ds_config_zero2.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/config/ds_config_zero2.json -------------------------------------------------------------------------------- /data/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/data/README.md -------------------------------------------------------------------------------- /data/README_zh.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/data/README_zh.md -------------------------------------------------------------------------------- /data/dataset_info.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/data/dataset_info.json -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/HH-RLHF/All_In_One.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/All_In_One.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/DPO.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/DPO.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/SFT.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/SFT.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/SPIN.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/SPIN.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Self-Contrast_1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Self-Contrast_1.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Self-Contrast_16.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Self-Contrast_16.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Self-Contrast_2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Self-Contrast_2.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Self-Contrast_4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Self-Contrast_4.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Self-Contrast_8.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Self-Contrast_8.sh -------------------------------------------------------------------------------- /scripts/HH-RLHF/Test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/HH-RLHF/Test.sh -------------------------------------------------------------------------------- /scripts/Nectar/DPO.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/DPO.sh -------------------------------------------------------------------------------- /scripts/Nectar/SFT.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/SFT.sh -------------------------------------------------------------------------------- /scripts/Nectar/SPIN.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/SPIN.sh -------------------------------------------------------------------------------- /scripts/Nectar/Self-Contrast_1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/Self-Contrast_1.sh -------------------------------------------------------------------------------- /scripts/Nectar/Self-Contrast_16.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/Self-Contrast_16.sh -------------------------------------------------------------------------------- /scripts/Nectar/Self-Contrast_2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/Self-Contrast_2.sh -------------------------------------------------------------------------------- /scripts/Nectar/Self-Contrast_4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/Self-Contrast_4.sh -------------------------------------------------------------------------------- /scripts/Nectar/Self-Contrast_8.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/Nectar/Self-Contrast_8.sh -------------------------------------------------------------------------------- /scripts/UltraChat/DPO.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/DPO.sh -------------------------------------------------------------------------------- /scripts/UltraChat/SPIN.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/SPIN.sh -------------------------------------------------------------------------------- /scripts/UltraChat/Self-Contrast_1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/Self-Contrast_1.sh -------------------------------------------------------------------------------- /scripts/UltraChat/Self-Contrast_16.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/Self-Contrast_16.sh -------------------------------------------------------------------------------- /scripts/UltraChat/Self-Contrast_2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/Self-Contrast_2.sh -------------------------------------------------------------------------------- /scripts/UltraChat/Self-Contrast_4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/Self-Contrast_4.sh -------------------------------------------------------------------------------- /scripts/UltraChat/Self-Contrast_8.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/scripts/UltraChat/Self-Contrast_8.sh -------------------------------------------------------------------------------- /src/compute_embeddings.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/compute_embeddings.py -------------------------------------------------------------------------------- /src/compute_output_reward.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/compute_output_reward.py -------------------------------------------------------------------------------- /src/compute_winrate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/compute_winrate.py -------------------------------------------------------------------------------- /src/construct_synthetic_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/construct_synthetic_data.py -------------------------------------------------------------------------------- /src/draw_figures.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/draw_figures.py -------------------------------------------------------------------------------- /src/inference.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/inference.py -------------------------------------------------------------------------------- /src/inference_valid.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/inference_valid.py -------------------------------------------------------------------------------- /src/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THUDM/Self-Contrast/HEAD/src/utils.py --------------------------------------------------------------------------------