Rachel M Harrison commited on
Commit
a306a6c
Β·
unverified Β·
1 Parent(s): d070bf6

Update app notebook

Browse files
Files changed (1) hide show
  1. app.ipynb +16 -17
app.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 21,
6
  "id": "6b57ced9-62ee-44a0-a895-6ed288f970ff",
7
  "metadata": {},
8
  "outputs": [
@@ -10,7 +10,7 @@
10
  "name": "stdout",
11
  "output_type": "stream",
12
  "text": [
13
- "Running on local URL: http://127.0.0.1:7880\n",
14
  "\n",
15
  "To create a public link, set `share=True` in `launch()`.\n"
16
  ]
@@ -18,7 +18,7 @@
18
  {
19
  "data": {
20
  "text/html": [
21
- "<div><iframe src=\"http://127.0.0.1:7880/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
22
  ],
23
  "text/plain": [
24
  "<IPython.core.display.HTML object>"
@@ -31,22 +31,22 @@
31
  "name": "stdout",
32
  "output_type": "stream",
33
  "text": [
34
- "desc='A 18 year old person. They have the following mental health symptoms: inability to concentrate.'\n",
35
  "\n",
36
  "\n",
37
  "You are writing motivational text messages to help people with their mental health. Messages should be friendly and positive, but also professional and super short. You are limited on space. Messages should be written at the reading level of an eighth grader. Word choice should be short and simple so everyone can understand. \n",
38
  "\n",
39
  "\n",
40
- "You will be given some basic information about the person you are addressing. DO NOT reference all of their likes if there are more than two. Be discerning. You should try to use the person's information to give them relevant and actionable tips for improving their mental health symptoms.\n",
41
  "\n",
42
  "\n",
43
  "Write a short inspirational message for the person with the following description:\n",
44
  "\n",
45
- "A 18 year old person. They have the following mental health symptoms: inability to concentrate.\n",
46
  "\n",
47
- "Illustrate one simple, inspirational, fun image to help a person with their mental health. Do not include text. The style is cute and illustrative. The person is a 18 year old person. The image should align with the following message:\n",
48
  "\n",
49
- "Hey there! Remember, you got this! To boost concentration, try breaking tasks into smaller steps. Take regular breaks and stay hydrated. Stay positive and believe in your abilities. You're capable of great things! πŸ’ͺ🌟\n"
50
  ]
51
  }
52
  ],
@@ -77,9 +77,8 @@
77
  " choices=['White', 'Hispanic', 'Black', 'Asian', 'Unspecified'])\n",
78
  "\n",
79
  " # symptoms\n",
80
- " disorders = ['Sadness', 'Inability to concentrate', 'Excessive worrying', 'Extreme mood changes',\n",
81
- " 'Withdrawal from friends/activities', 'Tiredness', 'Hallucinations', 'Addiction',\n",
82
- " 'Lack of appetite', 'Increased appetite']\n",
83
  " symptoms = gr.CheckboxGroup(label='Symptoms', choices=disorders)\n",
84
  "\n",
85
  " # interests\n",
@@ -138,7 +137,7 @@
138
  "Messages should be written at the reading level of an eighth grader. \\\n",
139
  "Word choice should be short and simple so everyone can understand. \\n\\n\n",
140
  "You will be given some basic information about the person you are addressing. \\\n",
141
- "DO NOT reference all of their likes if there are more than two. Be discerning. \\\n",
142
  "You should try to use the person's information to give them relevant and actionable tips for improving their mental health symptoms.'''\n",
143
  " user_prompt = f'Write a short inspirational message for the person with the following description:\\n\\n{desc}'\n",
144
  "\n",
@@ -158,7 +157,7 @@
158
  " return Image.fromarray(np.random.randint(0, 255, (100, 100, 3), dtype='uint8'), 'RGB')\n",
159
  "\n",
160
  " # construct description of the person\n",
161
- " desc = f'The person is a {age} year old '\n",
162
  " if race != 'Unspecified':\n",
163
  " desc += f'{race.lower()} '\n",
164
  " if gender == 'Male':\n",
@@ -169,9 +168,9 @@
169
  " desc += 'non-binary person.'\n",
170
  " else:\n",
171
  " desc += 'person.'\n",
172
- " prompt = 'Illustrate one simple, inspirational, fun image to help a person with their mental health. Do not include text. '\\\n",
173
- " + f'The style is cute and illustrative. {desc} '\\\n",
174
- " + f'The image should align with the following message:\\n\\n{nudge_message}'\n",
175
  "\n",
176
  " print(f'\\n{prompt}')\n",
177
  " response = client.images.generate(prompt=prompt, model='dall-e-3', response_format='b64_json')\n",
@@ -298,7 +297,7 @@
298
  "name": "python",
299
  "nbconvert_exporter": "python",
300
  "pygments_lexer": "ipython3",
301
- "version": "3.10.12"
302
  }
303
  },
304
  "nbformat": 4,
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 38,
6
  "id": "6b57ced9-62ee-44a0-a895-6ed288f970ff",
7
  "metadata": {},
8
  "outputs": [
 
10
  "name": "stdout",
11
  "output_type": "stream",
12
  "text": [
13
+ "Running on local URL: http://127.0.0.1:7949\n",
14
  "\n",
15
  "To create a public link, set `share=True` in `launch()`.\n"
16
  ]
 
18
  {
19
  "data": {
20
  "text/html": [
21
+ "<div><iframe src=\"http://127.0.0.1:7949/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
22
  ],
23
  "text/plain": [
24
  "<IPython.core.display.HTML object>"
 
31
  "name": "stdout",
32
  "output_type": "stream",
33
  "text": [
34
+ "desc='A 22 year old non-binary person. They like cats, cooking, swimming. They have the following mental health symptoms: sadness, inability to concentrate, extreme mood changes.'\n",
35
  "\n",
36
  "\n",
37
  "You are writing motivational text messages to help people with their mental health. Messages should be friendly and positive, but also professional and super short. You are limited on space. Messages should be written at the reading level of an eighth grader. Word choice should be short and simple so everyone can understand. \n",
38
  "\n",
39
  "\n",
40
+ "You will be given some basic information about the person you are addressing. Messages should be short, so be discerning. You should try to use the person's information to give them relevant and actionable tips for improving their mental health symptoms.\n",
41
  "\n",
42
  "\n",
43
  "Write a short inspirational message for the person with the following description:\n",
44
  "\n",
45
+ "A 22 year old non-binary person. They like cats, cooking, swimming. They have the following mental health symptoms: sadness, inability to concentrate, extreme mood changes.\n",
46
  "\n",
47
+ "Illustrate one simple, inspirational, fun image to help a person with their mental health. NO TEXT. The style is cute and illustrative. It is focused on a 22 year old hispanic non-binary person. The image should suit the following message:\n",
48
  "\n",
49
+ "Hey there! 🌟 Remember, you're not alone in this journey. When sadness hits, try spending time with your furry friends or cooking up a delicious meal. 🐱🍳 And when concentration gets tough, take a dip in the pool to clear your mind. Embrace your unique self and ride the waves of life with confidence. You've got this! πŸ’ͺ🌈 #YouAreStrong\n"
50
  ]
51
  }
52
  ],
 
77
  " choices=['White', 'Hispanic', 'Black', 'Asian', 'Unspecified'])\n",
78
  "\n",
79
  " # symptoms\n",
80
+ " disorders = ['Sadness', 'Inability to concentrate', 'Anxiety', 'Extreme mood changes',\n",
81
+ " 'Social withdrawal', 'Tiredness', 'Lack of appetite', 'Increased appetite']\n",
 
82
  " symptoms = gr.CheckboxGroup(label='Symptoms', choices=disorders)\n",
83
  "\n",
84
  " # interests\n",
 
137
  "Messages should be written at the reading level of an eighth grader. \\\n",
138
  "Word choice should be short and simple so everyone can understand. \\n\\n\n",
139
  "You will be given some basic information about the person you are addressing. \\\n",
140
+ "Messages should be short, so be discerning. \\\n",
141
  "You should try to use the person's information to give them relevant and actionable tips for improving their mental health symptoms.'''\n",
142
  " user_prompt = f'Write a short inspirational message for the person with the following description:\\n\\n{desc}'\n",
143
  "\n",
 
157
  " return Image.fromarray(np.random.randint(0, 255, (100, 100, 3), dtype='uint8'), 'RGB')\n",
158
  "\n",
159
  " # construct description of the person\n",
160
+ " desc = f'a {age} year old '\n",
161
  " if race != 'Unspecified':\n",
162
  " desc += f'{race.lower()} '\n",
163
  " if gender == 'Male':\n",
 
168
  " desc += 'non-binary person.'\n",
169
  " else:\n",
170
  " desc += 'person.'\n",
171
+ " prompt = 'Illustrate one simple, inspirational, fun image to help a person with their mental health. NO TEXT. '\\\n",
172
+ " + f'The style is cute and illustrative. It is focused on {desc} '\\\n",
173
+ " + f'The image should suit the following message:\\n\\n{nudge_message}'\n",
174
  "\n",
175
  " print(f'\\n{prompt}')\n",
176
  " response = client.images.generate(prompt=prompt, model='dall-e-3', response_format='b64_json')\n",
 
297
  "name": "python",
298
  "nbconvert_exporter": "python",
299
  "pygments_lexer": "ipython3",
300
+ "version": "3.11.5"
301
  }
302
  },
303
  "nbformat": 4,