huggingface / alignment-handbook

Robust recipes to align language models with human and AI preferences
https://huggingface.co/HuggingFaceH4
Apache License 2.0
4.55k stars 393 forks source link

Allow running DPO from a local model #49

Closed dmilcevski closed 10 months ago

dmilcevski commented 10 months ago

When giving a local path to model_name_or_path in config_full.yaml or config_lora.yaml for DPO training, the check if a model is adapter model, it only lists the files from HF repo and checks models pushed to HF hub. In case you want to run DPO from a local model, the checks need to be done directly in the local path.

The changes in this PR allow checking if a model is adapter model when a local path is supplied instead of HF model as well.