Wootang01 commited on
Commit
f5162aa
1 Parent(s): 74d4a51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,17 +1,20 @@
1
  import gradio as gr
 
 
 
2
  from transformers import pipeline
 
3
  title = "Next Sentence Generator"
 
4
  examples = [
5
  ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
6
  ["Zoe only recently began writing songs."],
7
  ["Zoe’s big break came when the godfather of Cantopop Sam Hui stumbled upon a YouTube video of Zoe singing."]
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
  gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
17
- title=title, examples=examples).launch(share=False, enable_queue=True)
 
1
  import gradio as gr
2
+ from gradio import inputs
3
+ from gradio.inputs import Textbox
4
+ from gradio import outputs
5
  from transformers import pipeline
6
+
7
  title = "Next Sentence Generator"
8
+ description = "Try this text generator!"
9
  examples = [
10
  ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
11
  ["Zoe only recently began writing songs."],
12
  ["Zoe’s big break came when the godfather of Cantopop Sam Hui stumbled upon a YouTube video of Zoe singing."]
13
  ]
 
 
 
14
 
15
  generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
16
  generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
17
  generator1 = gr.Interface.load("huggingface/gpt2-large")
18
+
19
  gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
20
+ title=title, description=description, examples=examples).launch(share=False, enable_queue=True)