ElAnon commited on
Commit
68fe1d4
1 Parent(s): 2243203

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -1,20 +1,17 @@
 
1
  import gradio as gr
2
 
3
- title = "GPT-J-6B"
4
 
5
- description = "Gradio Demo for GPT-J 6B, a transformer model trained \
6
- using Ben Wang's Mesh Transformer JAX. 'GPT-J' refers to the class of \
7
- model, while '6B' represents the number of trainable parameters."
8
 
 
 
 
 
9
 
10
- examples = [
11
- ['The tower is 324 metres (1,063 ft) tall,'],
12
- ["The Moon's orbit around Earth has"],
13
- ["The smooth Borealis basin in the Northern Hemisphere covers 40%"]
14
- ]
15
 
16
- gr.Interface.load("huggingface/EleutherAI/gpt-j-6B",
17
- inputs=gr.inputs.Textbox(lines=4, label="Input Text"),
18
- title=title,description=description,
19
- examples=examples,
20
- enable_queue=True).launch()
 
1
+ from aitextgen import aitextgen
2
  import gradio as gr
3
 
 
4
 
5
+ ai=aitextgen(model='EleutherAI/gpt-neo-1.3B',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_ = "AIBG"
14
+ description_ = " Enter 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()