PROMPT-EXTEND / app.py
prithivMLmods's picture
Update app.py
96a75e9 verified
raw
history blame
524 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 = " ",
fn=extend_prompt,
inputs=gr.Text(label="Type the prompt here"),
outputs=gr.TextArea(label='Extended prompt'),
title=" ",
theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate")
)
iface.launch()