# gpt2-quickly-ζ ·δΎ **Repository Path**: qzl121/gpt2-quick-sample ## Basic Information - **Project Name**: gpt2-quickly-ζ ·δΎ - **Description**: https://github.com/mymusise/gpt2-quickly/ - **Primary Language**: Python - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-06 - **Last Updated**: 2021-09-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
Build your own GPT2 quickly, without doing many useless work.
This project is base on π€ transformer. This tutorial show you how to train your own language(such as chinese or Japanese) GPT2 model in a few code with Tensorflow 2. You can try this project in [colab](https://colab.research.google.com/github/mymusise/gpt2-quickly/blob/main/examples/gpt2_quickly.ipynb) right now. ## Main file ``` βββ configs βΒ Β βββ test.py βΒ Β βββ train.py βββ build_tokenizer.py βββ predata.py βββ predict.py βββ train.py ``` ## Preparation ``` bash git clone git@github.com:mymusise/gpt2-quickly.git cd gpt2-quickly python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` ## 0x00. prepare your raw dataset this is a example of raw dataset: [raw.txt](dataset/test/raw.txt) ## 0x01. Build vocab ```bash python build_tokenizer.py ``` ## 0x02. Tokenize ```bash python predata.py --n_processes=2 ``` ## 0x03 Train ```bash python train.py ``` ## 0x04 Predict ```bash python predict.py ``` ## 0x05 Fine-Tune ```bash ENV=FINETUNE python finetune.py ```