from transformers import pipeline generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B') prompt = 'The thing I hate most' # can be anything res = generator(prompt, max_length=50, do_sample=True, temperature=0.7) print(res[0]['generated_text'])