File size: 332 Bytes
d0a1213 |
1 2 3 4 5 6 7 8 9 10 |
from transformers import pipeline
# Cargar un modelo pre-entrenado de generación de texto GPT-2
generator = pipeline('text-generation', model='gpt2')
# Generar texto con el modelo pre-entrenado
generated_text = generator("Once upon a time, in a land far, far away", max_length=100, num_return_sequences=1)
print(generated_text)
|