VerseCraft / app.py
marufc36
pp.py
c888487
raw
history blame
393 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-generation", model="poem_generator2", device=device)
def generate_poem(text):
res = pipe(text)[0]["generated_text"]
return res
iface = gr.Interface(
generate_poem,
gr.Textbox(lines=5, label="Enter text to start the Poetic Lines"),
gr.Textbox(label="Generated Poetic Lines")
)
iface.launch()