-
Notifications
You must be signed in to change notification settings - Fork 43
[QEff Finetune]: Adding steps about how to fine tune on any custom dataset. #381
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
base: main
Are you sure you want to change the base?
Conversation
quic-swatia
commented
Apr 28, 2025
•
edited
Loading
edited
- Added steps on how to create the custom_dataset.py to run fine-tuning through QEfficient pipeline on any custom dataset. Also, added a detailed template for the user which covers how to create custom_dataset.py
- Added the argument 'context_length' in the existing APIs which helps run fine tuning with padding for custom dataset.
Signed-off-by: Swati Allabadi <[email protected]>
8485344
to
e757ab8
Compare
Signed-off-by: Swati Allabadi <[email protected]>
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.
Good work in listing down the detailed steps for custom dataset, Swati! Please check on the comments. :)
To run fine tuning for any user specific dataset, prepare the dataset using the following steps: | ||
|
||
1) Create a directory named 'dataset' inside efficient-transformers. |
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.
double space between "a" and "directory"
|
||
def tokenize(): | ||
|
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.
Add some comment as "Implement tokenization and prepare inputs for the training."
# load dataset | ||
# based on split, retrieve only the specific portion of the dataset (train or eval) either here or at the last | ||
|
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.
Add one more comment as "Define a prompt template"
|
||
def apply_prompt_template(): | ||
|
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.
Add some comment as "Convert the raw input into format as per the template defined earlier."
5) Inside get_custom_dataset(), dataset needs to prepared for fine tuning. So, the user needs to apply prompt and tokenize the dataset accordingly. Please refer the below template on how to define get_custom_dataset(). | ||
6) For examples, please refer python files present in efficient-transformers/QEfficient/finetune/dataset. In case of Samsum dataset, get_preprocessed_samsum() of efficient-transformers/QEfficient/finetune/dataset/samsum_dataset.py is called. | ||
7) In efficient-transformers/QEfficient/finetune/configs/dataset_config.py, for custom_dataset class, pass the appropriate value for train_split and test_split according to the dataset keys corresponding to train and test data points. |
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 this is no longer needed after PR#289. We can directly pass --train_split and --test_split from the CLI.