Wootang01 commited on
Commit
3e5ffb2
·
1 Parent(s): 5b1d56f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -1,19 +1,11 @@
1
  import gradio as gr
2
- from aitextgen import aitextgen
3
 
4
- ai = aitextgen(model="EleutherAI/gpt-neo-2.7B")
5
-
6
- def ai_text(inp):
7
- generated_text = ai.generate_one(max_length=100, prompt = inp, no_repeat_ngram_size=3)
8
- print(type(generated_text))
9
- return generated_text
10
-
11
  examples = [
12
  ["Artificial intelligence will"],
13
  ["Probably everyone has heard of the 20 year-old singer named Zoe Kwan."],
14
  ["Mars, Joyce and Venus had their first day at Blazing Inventions Academy in North Point, Hong Kong. The following day, while Mars, Joyce and Venus are eating breakfast in the Academy’s hall, a green gas spreads from North Point throughout the world."]
15
  ]
16
-
17
- output_text = gr.outputs.Textbox()
18
- gr.Interface(ai_text,"textbox", output_text, title="Text Generator GPT-NEO-2.7B",
19
- description="Copy or type text. Submit and the machine will generate text.", examples=examples).launch(share=False)
 
1
  import gradio as gr
 
2
 
3
+ title="Text Generator GPT-NEO-2.7B"
4
+ description="Copy or type text. Submit and the machine will generate text."
 
 
 
 
 
5
  examples = [
6
  ["Artificial intelligence will"],
7
  ["Probably everyone has heard of the 20 year-old singer named Zoe Kwan."],
8
  ["Mars, Joyce and Venus had their first day at Blazing Inventions Academy in North Point, Hong Kong. The following day, while Mars, Joyce and Venus are eating breakfast in the Academy’s hall, a green gas spreads from North Point throughout the world."]
9
  ]
10
+
11
+ gr.Interface.load("EleutherAI/gpt-neo-2.7B", inputs=gr.inputs.Textbox(lines=5, label="Input Text"),title=title, description=description, examples=examples).launch(share=False)