Generate novel text based on given input text
novel finetuned from skt/kogpt2-base-v2
colab: colab
web demo: okteto kubernautic
japan web novel finetuned colab: kogpt2jnovel_colab
pip install torch==1.7.1+cu110
pip install fastai==2.4
pip install transformers==4.10.2
pip install BentoML==0.13.1
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("ttop324/kogpt2novel")
model = AutoModelWithLMHead.from_pretrained("ttop324/kogpt2novel")
inputs = tokenizer.encode("위치추적 전자장치(전자발찌) 훼손 전후로 여성 2명을 잇달아 살해한 ", return_tensors="pt")
output = model.generate(inputs,
repetition_penalty=2.0,
max_length=128,
use_cache=True)
output = tokenizer.decode(output[0])
print(output)
train.ipynb
deploy.ipynb