-
Notifications
You must be signed in to change notification settings - Fork 227
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
Pytorch Finetuning #6
Conversation
Hello. First, Thank you for your sincere pull request! |
I read your code quickly and I have some questions. |
train.py
Outdated
def load_model(model, state_dict, device): | ||
model = load_weight(model, state_dict) | ||
model.to(device) | ||
model.eval() |
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.
@jjbrophy47 Why did you try model.eval()
?
Didn't you mean fine tuning?
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.
Ooops! That line is a mistake and should be deleted, thanks.
GPT2/data.py
Outdated
else: | ||
|
||
# Plain text | ||
with open(path, 'r') as fp: |
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.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 43: ordinal not in range(128)
UnicodeDecodeError is occured in here. I think open with utf-8
is right.
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.
Ok I think that would be better, thanks.
branch name |
Thanks! I will also reflect the modifications to the master branch. |
Hi, I really like this repository and how easy it use to use as a PyTorch alternative for GPT2. In this pull request, I've added the ability to fine-tune a pre-trained gpt2 model in PyTorch. I've adapted training code from nshepperd: https://github.com/nshepperd/gpt-2/blob/finetuning/train.py
I hope you find this useful! Let me know if you have any questions or concerns!
-Jonathan Brophy