LLM_Ariphes / app.py
Euryeth's picture
api.py
461845f verified
raw
history blame
217 Bytes
from transformers import pipeline
model = pipeline("text-generation", model="gpt2")
def generate_text(prompt, max_length=100):
output = model(prompt, max_length=max_length)
return output[0]["generated_text"]