File size: 864 Bytes
75a9f38
 
 
a36c788
5ec0f84
75a9f38
5ec0f84
75a9f38
 
5ec0f84
bcf7379
75a9f38
 
9e54e99
 
 
 
 
57b4f44
dff0197
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from aitextgen import aitextgen
# Downloading gpt neo from hugging face model hub
ai= aitextgen(model='EleutherAI/gpt-neo-125M', to_gpu=False)
def ai_text(Input):
    # returning text as string for gradio
    generated_text= ai.generate_one(max_length=1000, prompt=Input, no_repeat_ngram_size=3)
    print(generated_text)
    return generated_text
    
output_text=gr.outputs.Textbox()
gr.Interface(ai_text, "textbox", 
             output_text, title="Centauri Pilot", 
             examples= [
             ['Chocolate gives bad skin'], 
             ['India has the highest population'],
             ['The moon is not a planet'], 
             ['Who is Alexander the Great?']],
             theme='dark-peach',
             description="V1 of Generating Blog Content using GPT-Neo by implementing aitextgen and Gradio").launch(inline=False)