Spaces:
Build error
Build error
File size: 604 Bytes
b5b11de e19d30d 5c668a1 e19d30d 5c668a1 e19d30d 2ada03e f8c07ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import gradio as gr
from transformers import pipeline
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B')
examples = [
["Once upon a time, Dr. Woo was teaching computer programming in a school."],
["Once upon a time, Dr. Woo was walking in a park. He "]
]
def generate(text):
result=generator(text, max_length=100, num_return_sequences=3)
return result[0]['generated_text']
gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label='input text'), outputs=gr.outputs.Textbox(label='output text'), title='My First Text Generator', examples=examples).launch() |