Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,22 +6,20 @@ title = "Current fine-tuned GPT3, AI-DHD"
|
|
6 |
description = "Your virtual ADHD coach designed by a Clinical Psychologist who has ADHD, named Alexander McLennan."
|
7 |
|
8 |
def question_answer(context, question):
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
start_sequence = "\\\n\nAI-DHD: "
|
13 |
restart_sequence = "\\\n\nGeorge: "
|
14 |
-
|
15 |
-
|
16 |
-
model="davinci:ft-placeholder-2022-12-10-04-13-26",
|
17 |
-
prompt=input,
|
18 |
-
temperature=0.13,
|
19 |
-
max_tokens=310,
|
20 |
-
top_p=1,
|
21 |
-
frequency_penalty=0.36,
|
22 |
-
presence_penalty=1.25
|
23 |
-
)
|
24 |
-
|
25 |
|
26 |
gr.Interface(
|
27 |
inference,
|
|
|
6 |
description = "Your virtual ADHD coach designed by a Clinical Psychologist who has ADHD, named Alexander McLennan."
|
7 |
|
8 |
def question_answer(context, question):
|
9 |
+
openai.api_key = "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"
|
10 |
+
|
11 |
+
response = openai.Completion.create(
|
12 |
+
model="davinci:ft-placeholder-2022-12-10-04-13-26",
|
13 |
+
prompt="App title: AI-DHD\nDescription: AI-DHD is a virtual coach in your pocket for support and assistance managing ADHD, designed by Alexander McLennan, a clinical psychologist based in Australia who has ADHD. AI-DHD will abide by the guidelines set out by AHPRA for psychologists. The AI will especially never provide potentially harmful advice to anyone.\n\nAI-DHD: Hey there, I'm your virtual ADHD coach. I can help you with anything you could ask a person who knows most things. Got a question for me?\\\n\nGeorge: Okay, you talk a big talk, haha. I attended Alexander's group last year and I'd love some reinforcement of those ideas. Did he say something about people-pleasing or something in the stuff on ADHD-related trauma?\\\n\nAI-DHD: Yes, people-pleasing is a common theme in ADHD. It's often driven by the desire to be liked and accepted. People with ADHD can feel like they're not good enough or that others will reject them if they don't do what other people want. This can lead to doing things for others without considering whether it's right for you or not.\\\n\nGeorge: Wow, I think I do that. I always have... but doesn't everyone?\\\n\nAI-DHD: Well, people-pleasing is a common theme in many neurotypical people as well. However, it's often more pronounced in those with ADHD because of the additional challenges that come with having ADHD. This includes feeling like you're not good enough or that others will reject you if you don't do what they want.\\\n\nGeorge: Can I put this behind me? Is it possible with your help?\\\n\nAI-DHD: Yes, it is possible to overcome this. It's important to remember that you're not a failure just because you've struggled with people-pleasing in the past. You can learn to be more mindful of when you're doing things for others and ensure that your own needs are being met as well.\\\n\nGeorge: Yeah, but honestly I've heard all of that here and there before. But, how do I actually move on in a positive way? Give me a step-by-step plan.\\\n\nAI-DHD: Okay, so the first thing to do is to identify what you want. This can be challenging for people with ADHD because we often jump from one task to another without really thinking about it. It's important to take some time out and think about what you actually want in life.",
|
14 |
+
temperature=0.13,
|
15 |
+
max_tokens=310,
|
16 |
+
top_p=1,
|
17 |
+
frequency_penalty=0.58,
|
18 |
+
presence_penalty=1.25,
|
19 |
start_sequence = "\\\n\nAI-DHD: "
|
20 |
restart_sequence = "\\\n\nGeorge: "
|
21 |
+
stop=["END", "\\", "\n"]
|
22 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
gr.Interface(
|
25 |
inference,
|