File size: 737 Bytes
f3e0781
84e11df
 
 
f3e0781
cbf6301
c3aff5f
 
f3e0781
cbf6301
6d609ba
cbf6301
7bd9d1c
b193890
cbf6301
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from transformers import pipeline

generator = pipeline('text-generation', model='huggingtweets/wwm_shakespeare')


def greet(input_words):
    return generator(input_words)[0]['generated_text']


iface = gr.Interface(fn=greet, inputs="text", outputs="text", layout='vertical',
                     title='Shakespeare Love Notes Generator',
                     description='Input some words, and generate some love notes in the writing style of William Shakespeare. Check the Linked Models for more detail.',
                     examples=['Chris', 'Love You', 'Special Day', 'Speak Love', 'Green Mountain', "Valentine's Day"], article='**Keep clicking Submit for more results with the same input**')
iface.launch()