- Notifications
You must be signed in to change notification settings - Fork0
discus0434/text-generation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Easy to use scripts to fine-tune GPT-2 Japanese model with your own text, to generate sentences, and to tweet them automatically.
git clone https://github.com/discus0434/text-generation.gitcd text-generation
pip install -r requirements.txt
conda create -n textgen python=3.9echo"source activate textgen">~/.bashrcconda run -n textgen pip install -r requirements.txt
docker build text-generation/. -t textgendocker run -it --runtime=nvidia -d --restart=always textgen:latest bash
Modify permission of shell scripts
chmod +x scripts/shell/setup.shchmod +x scripts/shell/finetune.shchmod +x scripts/shell/generate.sh
Runsetup.sh
to download a pretrained model
scripts/shell/setup.sh
Arrange.env
file in the project directory..env
file should look like this:
API_KEY = XXXAPI_SECRET_KEY = XXXBEARER_TOKEN = XXXACCESS_TOKEN = XXXACCESS_TOKEN_SECRET = XXX
You can not only make a Twitter bot but just generate sentences.
Arrange your text file you want to use insample_texts/
.
mv<your text file>.txt sample_texts/
...or download someone's tweets with Python script to use it
python ./scripts/python/download_tweets.py -u<Twitter user ID> -max<number of tweets you will get>
scripts/shell/finetune.sh
scripts/shell/generate.sh
...Run all of cells increate_tweet.ipynb
.
python ./scripts/python/create_tweets.py&disown
This code borrows fromgpt2-japanese.
About
Easy-to-use scripts to fine-tune GPT-2-JA with your own texts, to generate sentences, and to tweet them automatically.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.