dev114 commited on
Commit
98340f0
1 Parent(s): 26fa6bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -1,7 +1,15 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
7
  iface.launch()
1
  import gradio as gr
2
+ from aitextgen import aitextgen
3
 
4
+ ai = aitextgen(model="EleutherAI/gpt-neo-125M",to_gpu=True)
 
5
 
6
+ def ai_text(inp):
7
+ generated_text = ai.generate_one(max_length = 1000, prompt = inp, no_repeat_ngram_size = 3) #repetition_penalty = 1.9)
8
+ #print(type(generated_text))
9
+ return generated_text
10
+
11
+ output_text = gr.outputs.Textbox()
12
+ iface = gr.Interface(ai_text,"textbox", output_text, title="ai generated Blog with GPT-Neo",
13
+ description="AI Generated Blog Content with GPT-Neo - via {aitextgen}")
14
+
15
  iface.launch()