File size: 1,003 Bytes
daa6b4b
bfbcada
 
 
c4b9e3f
 
bfbcada
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7c2dc0
bfbcada
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr

title="Your App for Huggingface NLP models"

my_examples = [['What is Ayurveda? '],
             ['Dolo is prescribed for common cold and cough '],
             ['Covid 19 vaccines are regarded as an effective way to'],]

j_demo = gr.Interface.load(
    "huggingface/EleutherAI/gpt-j-6B",
    title="GPT-J 6B",
    examples=my_examples,
    inputs=gr.inputs.Textbox(lines=5,label="INPUT"),
    outputs="textarea",
)

neo27_demo = gr.Interface.load(
    "huggingface/EleutherAI/gpt-neo-2.7B",
    title="GPT-Neo 2.7B",
    examples=my_examples,
    inputs=gr.inputs.Textbox(lines=5,label="INPUT"),
    outputs="textarea",
)

neo125_demo = gr.Interface.load(
    "huggingface/EleutherAI/gpt-neo-125M",
    title="GPT-Neo 125M",
    examples=my_examples,
    inputs=gr.inputs.Textbox(lines=5,label="INPUT"),
    outputs="textarea",
)

demo = gr.TabbedInterface([j_demo, neo27_demo,neo125_demo], ["GPT-J 6B", "GPT-Neo 2.7B","GPT-Neo 125M"])

if __name__ == "__main__":
    demo.launch()