Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,41 +1,3 @@
|
|
1 |
-
Hugging Face's logo
|
2 |
-
Hugging Face
|
3 |
-
Search models, datasets, users...
|
4 |
-
Models
|
5 |
-
Datasets
|
6 |
-
Spaces
|
7 |
-
Docs
|
8 |
-
Solutions
|
9 |
-
Pricing
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
Spaces:
|
14 |
-
|
15 |
-
mshook
|
16 |
-
/
|
17 |
-
gpt2-story-generator-example Copied
|
18 |
-
private
|
19 |
-
|
20 |
-
Logs
|
21 |
-
App
|
22 |
-
Files
|
23 |
-
Community
|
24 |
-
Settings
|
25 |
-
gpt2-story-generator-example
|
26 |
-
/
|
27 |
-
app.py
|
28 |
-
mshook's picture
|
29 |
-
mshook
|
30 |
-
Update app.py
|
31 |
-
26c39e6
|
32 |
-
43 minutes ago
|
33 |
-
raw
|
34 |
-
history
|
35 |
-
blame
|
36 |
-
edit
|
37 |
-
delete
|
38 |
-
735 Bytes
|
39 |
import gradio as gr
|
40 |
from transformers import pipeline
|
41 |
|
@@ -59,4 +21,17 @@ demo = gr.Interface(
|
|
59 |
examples=examples
|
60 |
)
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
21 |
examples=examples
|
22 |
)
|
23 |
|
24 |
+
demo.launch()
|
25 |
+
["<BOS> <sci_fi> After discovering time travel,"],
|
26 |
+
["<BOS> <superhero> Batman"],
|
27 |
+
["<BOS> <drama> Legolas and Gimli advanced on the orcs, raising their weapons with a harrowing war cry"],
|
28 |
+
]
|
29 |
+
|
30 |
+
demo = gr.Interface(
|
31 |
+
fn=generate,
|
32 |
+
inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
|
33 |
+
outputs=gr.outputs.Textbox(label="Generated Text"),
|
34 |
+
examples=examples
|
35 |
+
)
|
36 |
+
|
37 |
demo.launch()
|