Wootang01 commited on
Commit
1beb286
·
1 Parent(s): 4113f86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,7 +1,15 @@
1
- import gradio as gr
2
- from gradio.mix import Parallel
3
 
4
- model1 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-125M")
5
- model2 = gr.Interface.load("huggingface/bigscience/bloom-560m")
 
6
 
7
- gr.Parallel(model1, model2).launch()
 
 
 
 
 
 
 
 
 
1
+ generator = pipeline('text-generation', model='bigscience/bloom-560m')
 
2
 
3
+ def generate(text):
4
+ result = generator(text, max_length=100, num_return_sequences=1)
5
+ return result[0]["generated_text"]
6
 
7
+ examples = [
8
+ ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
9
+ ["Zoe only recently began writing songs."],
10
+ ]
11
+
12
+ demo = gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label="Input Text"), outputs=gr.outputs.Textbox(label="Generated Text"),
13
+ examples=examples)
14
+
15
+ demo.launch()