CoolFace
Apppublic

SpawnedShoyo/text-generation

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
app.py22 linesDownload Raw Back to root
1import gradio as gr2from transformers import pipeline3 4text_generator = pipeline("text-generation", model="EleutherAI/gpt-neo-2.7B")5 6def generate_text(prompt):7    generated_text = text_generator(prompt, max_length=200)[0]["generated_text"]8    return generated_text9 10iface1 = gr.Interface(11    generate_text,12    inputs="text",13    outputs="text",14    title="Hugging Face Text Generation",15    description="Generate text using Hugging Face's GPT-Neo 2.7B model.",16    examples=[17        ["The quick brown fox",],18        ["Once upon a time",],19        ["In a galaxy far, far away",],20    ],21)22iface1.launch()