Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
title = "Story Generators"
|
| 4 |
+
examples = [
|
| 5 |
+
["Elon Musk of Tesla said today"],
|
| 6 |
+
["Mark Zuckerberg of Meta and Oculus said today about VR"],
|
| 7 |
+
["Lex Fridman once said regarding his MIT career"]
|
| 8 |
+
]
|
| 9 |
+
from gradio import inputs
|
| 10 |
+
from gradio.inputs import Textbox
|
| 11 |
+
from gradio import outputs
|
| 12 |
+
|
| 13 |
+
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
|
| 14 |
+
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
| 15 |
+
generator1 = gr.Interface.load("huggingface/gpt2-large")
|
| 16 |
+
|
| 17 |
+
gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
|
| 18 |
+
title=title, examples=examples).launch(share=False)
|