Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ORPO example and e2e test #1572

Merged
merged 10 commits into from
Apr 27, 2024
Merged

Conversation

tokestermw
Copy link
Contributor

Description

  1. Add e2e test for ORPO
  2. Add an ORPO example config

Motivation and Context

Current example in rlhf.qmd gives an error:

    train_dataset, eval_dataset = load_prepare_dpo_datasets(cfg)
  File "/src/tokestermw/axolotl/src/axolotl/utils/data/rl.py", line 114, in load_prepar
e_dpo_datasets
    train_dataset = load_split(cfg.datasets, cfg)
  File "/src/tokestermw/axolotl/src/axolotl/utils/data/rl.py", line 88, in load_split
    sig = inspect.signature(ds_transform_fn)
  File "/usr/lib/python3.10/inspect.py", line 3254, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
  File "/usr/lib/python3.10/inspect.py", line 3002, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "/usr/lib/python3.10/inspect.py", line 2396, in _signature_from_callable
    raise TypeError('{!r} is not a callable object'.format(obj))

(the example points to orpo.chat_template, which isn't a transform_fn).

So we add an example in examples/mistral/mistral-qlora-orpo.yaml and an e2e test.

How has this been tested?

Run the example

accelerate launch -m axolotl.cli.train examples/mistral/mistral-qlora-orpo.yml

e2e test

# remove pytest.mark.skip manually first
pytest tests/e2e/test_dpo.py::TestDPOLlamaLora::test_orpo_lora

@winglian
Copy link
Collaborator

thanks for catching the changes and updating @tokestermw !

@winglian winglian merged commit 98c25e1 into axolotl-ai-cloud:main Apr 27, 2024
7 checks passed
djsaunde pushed a commit that referenced this pull request Dec 17, 2024
* add example for mistral orpo

* sample_packing: false for orpo

* go to load_dataset (since load_rl_datasets require a transfom_fn, which only dpo uses currently)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants