Skip to content

How to finetune with a text file? #124

Answered by WissamAntoun
Mennaruuk asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

Can I suggest you try the pytorch notebook from huggingface here https://github.com/huggingface/notebooks/blob/master/examples/language_modeling.ipynb

or you can check the single command training from the examples folder https://github.com/huggingface/transformers/tree/master/examples/pytorch/language-modeling

To run on your own training and validation files, use the following command:

python run_clm.py \
    --model_name_or_path gpt2 \
    --train_file path_to_train_file \
    --validation_file path_to_validation_file \
    --do_train \
    --do_eval \
    --output_dir /tmp/test-clm

This uses the built in HuggingFace Trainer for training. If you want to use a custom training loop, y…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by WissamAntoun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants