File size: 1,037 Bytes
008e7ae
1946b40
 
 
 
f5162aa
008e7ae
f5162aa
1b6d589
fcc2804
 
 
1b6d589
008e7ae
673c3c9
0082540
a5311b3
f5162aa
9e00702
 
1946b40
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
#from gradio import inputs
#from gradio.inputs import Textbox
#from gradio import outputs
#from transformers import pipeline

title = "Next Sentence Generator"
description = "Try this text generator!"
examples = [
    ["Zoe Kwan is a 20-year old singer and songwriter."],
    ["Zoe Kwan only recently began writing songs."],
    ["Zoe Kwan has taken Hong Kong’s music scene by storm."]
]

generator2 = gr.load("huggingface/facebook/opt-1.3b")
generator3 = gr.load("huggingface/gpt2")
generator1 = gr.load("huggingface/bigscience/bloom-1b1")

gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence"), 
            title=title, description=description, examples=examples).launch(enable_queue=True)

#gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
#            title=title, description=description, examples=examples).launch(share=False, enable_queue=True)