-
Notifications
You must be signed in to change notification settings - Fork 138
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
Adds fine tuning contrib example #667
Conversation
This module shows how one can perform fine tuning using Hamilton. It is a basic example using the transformers library that connects to huggingface to pull and fine tune a FLAN model. One should be able to adapt this code to their needs.
2012c89
to
9ec145f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify a bit by:
- Removing inference from this -- that should be a snippet of code in the README of an
ipynb
or something - Processing features prior to splitting the dataset
- Fixing up/removing some of the docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we tokenize the dataset before splitting? That'll kill a lot of duplicate code and make it easier to read.
Otherwise this looks fine, I think you should break it out cause it's doing too much and I find that hard to follow, but let's just get it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, maybe _preprocess_function
should do the dataset .map
call
So that people know to change it to match their dataset.
With latest contrib additions.
This module shows how one can perform fine tuning using Hamilton. It is a basic example using the transformers library that connects to huggingface to pull and fine tune a FLAN model.
One should be able to adapt this code to their needs.
For new dataflows:
Do you have the following?
and notices as appropriate.
How I tested this
Ran it locally in a docker container
Notes
We might want to invest in making it so that multiple modules could make a contribution because that could help segment the code better.
Checklist