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

[ENH] Improved data preparation for LLM finetuning #8692

Merged
merged 15 commits into from
Jan 31, 2024

Conversation

paxcema
Copy link
Member

@paxcema paxcema commented Jan 25, 2024

Description

This PR introduces some common data preparation utilities for fine-tuning LLMs that operate following the ChatCompletion format from OpenAI. Currently, these coupled versions of these methods are actively being used in our integrations for Anyscale and OpenAI (hence indirectly by LangChain, too).

Added tests for all of these, so that we can use them on any other LLM engines.

Type of change

  • ⚡ New feature (non-breaking change which adds functionality). Refactor.

Verification Process

To ensure the changes are working as expected:

  • Test Location: added unit tests, which pass.

Additional Media:

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

@paxcema paxcema changed the title [Feat] Improved data preparation for LLM finetuning [ENH] Improved data preparation for LLM finetuning Jan 25, 2024
@paxcema paxcema marked this pull request as ready for review January 31, 2024 00:22
@paxcema paxcema requested a review from dusvyat January 31, 2024 00:22
Copy link
Contributor

@dusvyat dusvyat left a comment

Choose a reason for hiding this comment

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

LGTM, see minor point

tests/unit/test_llm_utils.py Show resolved Hide resolved
Copy link

@pedrofluxa pedrofluxa left a comment

Choose a reason for hiding this comment

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

Left a comment on a hard-coded value. I am approving this PR as it should work as it is, but I strongly suggest to refactor the code a little bit.

@paxcema paxcema merged commit 650fd7c into staging Jan 31, 2024
10 checks passed
@paxcema paxcema self-assigned this Feb 1, 2024
@chandrevdw31
Copy link
Contributor

Unable to Finetune as it says False

image

@paxcema
Copy link
Member Author

paxcema commented Feb 8, 2024

@chandrevdw31 status is marked as generating in the screenshot above, and these finetune runs can easily take hours so this is normal. The model cannot be active before its status is complete.

If the user reports an actual error in the model record, please ask them to open a bug with it.

@StpMax StpMax mentioned this pull request Feb 19, 2024
@hamishfagg hamishfagg deleted the feat/improved_ft_dataprep branch June 10, 2024 21:32
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.

None yet

4 participants