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

Fix data loading for DPO and other formats like parquet. #1283

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhilipMay
Copy link
Contributor

@PhilipMay PhilipMay commented Feb 9, 2024

If you want to do DPO with a locale file at the moment it is only possible with jsonl files.
This enables it for more file formats like parquet.

fixes #1282

@PhilipMay
Copy link
Contributor Author

@filippo82 can you please review this? Many thanks.

Copy link
Collaborator

@winglian winglian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we figure out another way of integrating this? I think it's valuable to attempt to load other file formats.

ds = load_dataset( # pylint: disable=invalid-name
ds_cfg["path"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little wary of completely removing a working code path. We do t have a lot of test coverage of the various file loading use cases so my confidence this won't break existing use cases is low.

Copy link
Contributor Author

@PhilipMay PhilipMay Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. You are right.
The sft code is much more complicated.
See: https://github.com/OpenAccess-AI-Collective/axolotl/blob/b2a4cb4396922fdd2242981a99e79f8b213ac4a4/src/axolotl/utils/data.py#L292-L376
But how do we fix this issue?
Should the user be forced to use jsonl if he or she wants to use a locale file?

@PhilipMay
Copy link
Contributor Author

Can we figure out another way of integrating this? I think it's valuable to attempt to load other file formats.

I think of a step by step approach:

  1. refactor the data loading logic of sft into a dedicated function - see https://github.com/OpenAccess-AI-Collective/axolotl/blob/b2a4cb4396922fdd2242981a99e79f8b213ac4a4/src/axolotl/utils/data.py#L292-L376

  2. check how and if we can reuse the function for DPO data loading

@winglian
Copy link
Collaborator

Can we figure out another way of integrating this? I think it's valuable to attempt to load other file formats.

I think of a step by step approach:

  1. refactor the data loading logic of sft into a dedicated function - see https://github.com/OpenAccess-AI-Collective/axolotl/blob/b2a4cb4396922fdd2242981a99e79f8b213ac4a4/src/axolotl/utils/data.py#L292-L376
  2. check how and if we can reuse the function for DPO data loading

That all seems sound to me. 👍

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.

DPO training from locale file only works for jsonl files
2 participants