Wednesday, August 21, 2019

Generate Text using OpenAIGPT2 in Python

!git clone https://github.com/graykode/gpt-2-Pytorch
import os
os.chdir('gpt-2-Pytorch')
!curl --output gpt2-pytorch_model.bin https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin
!pip install -r requirements.txt
!python main.py --text "Chandrayaan-2 is India's second lunar exploration mission after Chandrayaan-1. Developed by the Indian Space Research Organisation, the mission was launched from the second launch pad at Satish Dhawan Space Centre on 22 July 2019 at 2.43 PM IST to the Moon by a Geosynchronous Satellite Launch Vehicle Mark III."

No comments: