File size: 669 Bytes
d0e1700
7681358
 
05014cf
1ed9f2a
 
05014cf
 
deb4b1d
480e0ae
 
548b35e
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#level 1 text generator
import gradio as gr

examples = [
    ["Once upon a time, "],
    ["One day, "]
]

gr.load("huggingface/psmathur/orca_mini_3b", title='My Second Text Generator', examples=examples).launch()


#import gradio as gr
#from transformers import pipeline

#generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B')

#def generate(text):
#    result=generator(text, max_length=100, num_return_sequences=3)
#    return result[0]['generated_text']

#gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label='input text'), outputs=gr.outputs.Textbox(label='output text'), title='My First Text Generator', examples=examples).launch()