Wootang01 commited on
Commit
9aaeb64
·
1 Parent(s): 959a4d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -1,11 +1,17 @@
 
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"), title=title, description=description, examples=examples).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from aitextgen import aitextgen
2
  import gradio as gr
3
 
 
 
 
 
 
 
 
4
 
5
+ ai=aitextgen(model='EleutherAI/gpt-neo-2.7B',to_gpu=False) # EleutherAI/gpt-neo-2.7B EleutherAI/gpt-neo-1.3B
6
+
7
+ def ai_text(Input):
8
+ generated_text = ai.generate_one(max_length = 500, prompt = Input, no_repeat_ngram_size = 3) #repetition_penalty = 1.9)
9
+ #print(type(generated_text))
10
+ return generated_text
11
+
12
+
13
+ title_ = "Text Generator GPT-Neo-12.7B"
14
+ description_ = " Enter one or more sentences and it will generate a 500 words blog 🤓"
15
+ output_text = gr.outputs.Textbox()
16
+ iface=gr.Interface(ai_text,"textbox", output_text, title=title_,description=description_)#.launch()
17
+ iface.launch()