File size: 711 Bytes
5a61290
 
 
3a454bf
5a61290
 
 
 
 
 
 
 
1fd5c6a
82cfe4f
 
 
 
 
 
 
5a61290
82cfe4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from transformers import pipeline
import gradio as gr

pipe = pipeline('text-generation', model='daspartho/prompt-extend')

def extend_prompt(prompt):
    return pipe(prompt+',', num_return_sequences=1)[0]["generated_text"]

iface = gr.Interface(
    fn=extend_prompt, 
    inputs=gr.Text(label="Type the prompt here"), 
    outputs=gr.TextArea(label='Extended prompt'),
    title="PROMPT EXTENDER",
    examples=[
        ["Write a creative story about a robot learning to paint."],
        ["Generate a poem about the beauty of nature."],
        ["Create a dialogue between a detective and a suspect."],
        ["Imagine a futuristic city where technology and art blend seamlessly."]
    ]
)

iface.launch()