File size: 641 Bytes
9aaeb64
7681358
 
3e5ffb2
9aaeb64
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from aitextgen import aitextgen
import gradio as gr


ai=aitextgen(model='EleutherAI/gpt-neo-2.7B',to_gpu=False) # EleutherAI/gpt-neo-2.7B EleutherAI/gpt-neo-1.3B

def ai_text(Input):
  generated_text = ai.generate_one(max_length = 500, prompt = Input, no_repeat_ngram_size = 3) #repetition_penalty = 1.9)
  #print(type(generated_text))
  return generated_text


title_ = "Text Generator GPT-Neo-12.7B"
description_ = " Enter one or more sentences and it will generate a 500 words blog 🤓"
output_text = gr.outputs.Textbox()
iface=gr.Interface(ai_text,"textbox", output_text, title=title_,description=description_)#.launch()
iface.launch()