Build Text Generator app with GPT-Neo by EleutherAI and GPT2 by OpenAI using Transformer.
Source :
- GPT-Neo : Github, HuggingFace
- GPT2 : Github, HuggingFace
- Transformers - Text Generation Strategies : HuggingFace
How to run:
- Clone this repository
git clone https://github.com/marwanmusa/AI-Text-Generation.git
- Make virtual environment on your local directory
python -m venv "your_env_name"
- Activate the environment
"your_env_name"/Scripts/Activate.ps1
- Install dependencies in requirements.txt
pip install -r path/to/requirements.txt
or if you are using pipenv, then
pipenv install -r path/to/requirements.txt
- Run
.py
files
python GPTNeo.py # for GPTNeo
python GPT2.py # for GPT2
Note
You need to adjust your torch installation version to match with your cuda toolkit version installed.