

There is unnecessary line Setting 'pad_token_id' to 'eos_token_id':2 for open-end generation.I certainly did it, but there are the following problems as you could see in Let's talk to the model section. I fine-tuned GPT-2 with my chat history on LINE.
FINETUNE GPT2 HOW TO
Then, the source code is running and you could talk with the model, like the following. This video shows how to fine tune GPT-2 on custom data, it is advisable to first check out my beginners tutorial before embarking on this step.The fine tunin. You would see your model file in the directory that is specified in model_config.yaml.Īgain, all you have to do is run the only one cell in Talking with the model block. That is all! After running this cell, all you have to do is wait for a while. 6: Run the cells in Training data preparation and Building model block.You can change basemodel to rinna/japanese-gpt2-small, but others (medium and 1b) would not work because of a lack of GPU memory as I mentioned in What is rinna section. You have to change input_path in dataset block to the path to the cleaned data, which is specified in pre_processor_config.yaml. Note that, if your LINE setting language is Japanese, you should change it to English until exporting a chat history because the following processes are supposing the setting language (not message language) is English.Īt the end of this process, your google drive is constructed as follows.Įnter fullscreen mode Exit fullscreen mode


If you have the account, the following processes would work. I know these processes are the hardest and most bothering things though. All you have to do is prepare a chat history and modify the data. If you have no account on the app, it is okay. I will suppose you have a google and git account and can use google colab.įurthermore, I will use a chat history on LINE. By the way, I wanted to use rinna/japanese-gpt-1b whose number of parameters is around one billion, but I couldn't because of the memory capacity on google colab. I will fine-tune rinna/japanese-gpt2-small whose number of parameters is small. I am not sure when the models are published on hugging face, but anyways, the models are available now. rinna is a bit famous in Japanese because they published rinna AI on LINE, one of the most popular SNS apps in Japan. and five pre-trained models are available on hugging face on 19, February 2022. Rinna is a conversational pre-trained model given from rinna Co., Ltd. Thanks to the second author, I could go through GPT-2. The sources in my git repository are almost constructed with his codes. Thanks to the first author, I could build my chatbot model.
