Spaces:
Runtime error
Runtime error
Moving the model to Interface.load function as first parameter
Browse files
app.py
CHANGED
|
@@ -1,15 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
|
| 5 |
-
generated_story = story_gen("<BOS> <superhero> Batman")
|
| 6 |
-
return generated_story
|
| 7 |
-
interface = gr.Interface(
|
| 8 |
-
fn=generate_story,
|
| 9 |
title="Story Generation with GPT-2",
|
| 10 |
inputs=[gr.Textbox(lines=7, label="Story")],
|
| 11 |
description="Story generation with GPT-2",
|
| 12 |
examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
|
| 13 |
-
outputs=[gr.Textbox(label='
|
| 14 |
)
|
| 15 |
interface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
interface = gr.Interface.load(
|
| 3 |
+
"huggingface/pranavpsv/gpt2-genre-story-generator",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
title="Story Generation with GPT-2",
|
| 5 |
inputs=[gr.Textbox(lines=7, label="Story")],
|
| 6 |
description="Story generation with GPT-2",
|
| 7 |
examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
|
| 8 |
+
outputs=[gr.Textbox(label='Story Generation Output')]
|
| 9 |
)
|
| 10 |
interface.launch()
|