dk-crazydiv commited on
Commit
a490fc1
·
1 Parent(s): 89e5b84

Added self affirmations

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -10,10 +10,12 @@ def generate_hashtags(input):
10
  if len(input) == 0:
11
  return None
12
 
13
- if category == "positive_affirmation":
14
  input_prompt = "This program will take a sentence as input and reframe it with positive and growth mindset.\n--\nInput: I have a lot of work to do today.\nOutput: I have a lot of work to do today. It's better for me to make a list and break it down into smaller chunks and finish them off one by one.\n--\nInput: I am barely able to lift 10 pound weights.\nOutput: I should exercise more consistently and gradually increase my weight limit. I should also try eating healthy foods.\n--\nInput: {}\nOutput:".format(input.strip())
15
  if category == "remove_negations":
16
  input_prompt = "This program takes an input and reframes it by removing negative words and rephrasing with with positivity while preserving the meaning of the original sentence. The word 'no' doesn't appear in the output\n--\nInput: I wouldn’t say I don’t want to go.\nOutput: I would like to go.\n--\nInput: That’s not a bad idea.\nOutput: That is a good idea.\n--\nInput: {}\nOutput:".format(input.strip())
 
 
17
  response = co.generate(
18
  model='xlarge',
19
  prompt=input_prompt,
@@ -36,7 +38,7 @@ input = st.text_area('Enter your post title caption here', height=100)
36
 
37
  category = st.radio(
38
  "Please select a category",
39
- ('positive_affirmation', 'remove_negations'))
40
 
41
  if st.button('Reframe'):
42
  output = generate_hashtags(input)
 
10
  if len(input) == 0:
11
  return None
12
 
13
+ if category == "growth":
14
  input_prompt = "This program will take a sentence as input and reframe it with positive and growth mindset.\n--\nInput: I have a lot of work to do today.\nOutput: I have a lot of work to do today. It's better for me to make a list and break it down into smaller chunks and finish them off one by one.\n--\nInput: I am barely able to lift 10 pound weights.\nOutput: I should exercise more consistently and gradually increase my weight limit. I should also try eating healthy foods.\n--\nInput: {}\nOutput:".format(input.strip())
15
  if category == "remove_negations":
16
  input_prompt = "This program takes an input and reframes it by removing negative words and rephrasing with with positivity while preserving the meaning of the original sentence. The word 'no' doesn't appear in the output\n--\nInput: I wouldn’t say I don’t want to go.\nOutput: I would like to go.\n--\nInput: That’s not a bad idea.\nOutput: That is a good idea.\n--\nInput: {}\nOutput:".format(input.strip())
17
+ if category == "self_affirmation":
18
+ input_prompt = "This program takes an input and reframes it with positive affirmations.\n-- \nInput: I am worthless\nOutput: I have value and my actions impact the world around me.\n--\nInput: I am a failure\nOutput: I never fail, only my attempts do. I will keep trying and improving\n--\nInput: I don’t like myself\nOutput: I accept myself and improve what I can.\n--\nInput: {}\nOutput:".format(input.strip())
19
  response = co.generate(
20
  model='xlarge',
21
  prompt=input_prompt,
 
38
 
39
  category = st.radio(
40
  "Please select a category",
41
+ ('growth', 'remove_negations', 'self_affirmation'))
42
 
43
  if st.button('Reframe'):
44
  output = generate_hashtags(input)