PROMPT-EXTEND / app.py
prithivMLmods's picture
Update app.py
a4c548f verified
raw
history blame
676 Bytes
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(
description = "Enter a main idea for a prompt, and the model will attempt to add suitable style cues.",
article = "<p style='text-align: center'><a href='https://github.com/PRITHIVSAKTHIUR/Prompt-Extender-Gpt' target='_blank'>🫙🪶</a></p>",
fn=extend_prompt,
inputs=gr.Text(label="Type the prompt here"),
outputs=gr.TextArea(label='Extended prompt'),
title="Prompt Extender"
)
iface.launch()