File size: 2,141 Bytes
9e5e8af
2fde736
9e5e8af
cab763a
59d9723
9e5e8af
3f5b34c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f849fad
1a864c9
 
 
 
 
 
e210cd1
 
 
 
9e5e8af
 
 
 
 
2fde736
59d9723
 
2fde736
 
 
59d9723
 
9e5e8af
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import gradio as gr
import os
from transformers import pipeline
title = "📗Health and Mindful Story Gen❤️"

examples = [
    ["Mental Body Scan"],
    ["Stretch, Calm, Breath"],
    ["Relaxed Seat Breath"],
    ["Walk Feel"],
    ["Brain gamification"],
    ["alleviating stress"],
    ["helping breathing, satisfaction"],
    ["Relieve Stress, Build Support"],
    ["Relaxation Response"],
    ["Deep Breaths"],
    ["Delete Not Helpful Thoughts"],
    ["Strengthen Helpful"],
    ["Reprogram Pain Stress Reactions"],
    ["Sleep Better and Find Joy"],
    ["Yoga Sleep"],
    ["Being a Happier and Healthier Person"],
    ["Relieve Pain"],
    ["Learn to Use Mindfulness to Affect Well Being"],
    ["Build and Boost Mental Strength"],
    ["Spending Time Outdoors"],
    ["Daily Routine Tasks"],
    ["Eating and Drinking - Find Healthy Nutrition Habits"],
    ["Drinking - Find Reasons and Cut Back or Quit Entirely"],
    ["Feel better each day when you awake by"],
    ["Feel better physically by"],
    ["Practicing mindfulness each day"],
    ["Be happier by"],
    ["Meditation can improve health"],
    ["Spending time outdoors"],
    ["Stress is relieved by quieting your mind, getting exercise and time with nature"],
    ["Break the cycle of stress and anxiety"],
    ["Feel calm in stressful situations"],
    ["Deal with work pressure"],
    ["Learn to reduce feelings of overwhelmed"]
]
from gradio import inputs
from gradio.inputs import Textbox
from gradio import outputs

HF_TOKEN = os.environ.get("HF_TOKEN")    # get token from secrets, copy token value HF_TOKEN from Profile settings token into this repo settings


generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN) # add api_key=HF_TOKEN to get over the quota error
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
generator1 = gr.Interface.load("huggingface/gpt2-large", api_key=HF_TOKEN)


gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
            title=title, examples=examples).launch(share=False)