Spaces:
Runtime error
Runtime error
# import gradio as gr | |
# gr.Interface.load("models/EleutherAI/gpt-neo-1.3B").launch() | |
# import gradio as gr | |
# description = "Story generation with GPT" | |
# examples = [["An adventurer is approached by a mysterious stranger in the tavern for a new quest."]] | |
# demo = gr.Interface.load("models/EleutherAI/gpt-neo-1.3B", description=description, examples=examples) | |
# demo.launch() | |
import gradio as gr | |
from transformers import pipeline | |
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B') | |
examples = [ | |
["Then all went silent..."], | |
] | |
def generate(text): | |
result=generator(text, min_length=200, max_length=600, 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='Testing Text Generator', examples=examples).launch() | |