Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,17 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
title = "GPT-J-6B"
|
4 |
|
5 |
-
|
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 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
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()
|