CoolFace
Apppublic

locust/01-NLP-Sentence2Paragraph

sourceHugging Facemitupdated 4y agoView on Hugging Face
1likes
app.py24 linesDownload Raw Back to root
1import gradio as gr2from transformers import pipeline3title = "Transformers 📗 Sentence to Paragraph ❤️ For Mindfulness"4examples = [5    ["Feel better physically by"],6    ["Practicing mindfulness each day"],7    ["Be happier by"],8    ["Meditation can improve health"],9    ["Spending time outdoors"],10    ["Stress is relieved by quieting your mind, getting exercise and time with nature"],11    ["Break the cycle of stress and anxiety"],12    ["Feel calm in stressful situations"],13    ["Deal with work pressure"],14    ["Learn to reduce feelings of overwhelmed"]15]16from gradio import inputs17from gradio.inputs import Textbox18from gradio import outputs19 20generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")21generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")22generator1 = gr.Interface.load("huggingface/gpt2-large")23gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),24            title=title, examples=examples).launch(share=False)