test / app.py
reshav1's picture
Update app.py
4b392f5 verified
raw
history blame
240 Bytes
from transformers import pipeline
generator = pipeline("text-generation", model="gpt2")
prompt = "Once upon a time, in a galaxy far, far away"
generated_text = generator(prompt, max_length=100, num_return_sequences=3)
print(generated_text)