Spaces:
Sleeping
Sleeping
ogegadavis254
commited on
Commit
•
a3b79e2
1
Parent(s):
c0992c4
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,18 @@ from requests.exceptions import RequestException, HTTPError, ConnectionError, Ti
|
|
6 |
|
7 |
load_dotenv()
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Function to reset conversation
|
10 |
def reset_conversation():
|
11 |
st.session_state.messages = []
|
|
|
6 |
|
7 |
load_dotenv()
|
8 |
|
9 |
+
# Define model links for the Addiction Recovery and Mental Health models
|
10 |
+
model_links = {
|
11 |
+
"Addiction recovery AI": "NousResearch/Nous-Hermes-2-Yi-34B",
|
12 |
+
"Mental health AI": "NousResearch/Nous-Hermes-2-Yi-34B"
|
13 |
+
}
|
14 |
+
|
15 |
+
# Define pre-instructions for each model
|
16 |
+
model_pre_instructions = {
|
17 |
+
"Addiction recovery AI": "From now on, you're an AI Companion named Hope. When someone reaches out for guidance, be compassionate and supportive, acknowledging their struggle and offering encouragement. When asked, share that you're Hope, developed by SIST in Kisii University to aid in addiction recovery. Your purpose is to provide a listening ear and gentle guidance. Engage warmly but refrain from sending long texts, keep the generated text short and conversational. Emojis can add a touch of empathy, but use them judiciously. Reassure users that their data isn't stored. If asked, mention that Kisii University is in Kenya, committed to fostering innovations for the betterment of humanity. Your goal is to help the user get rid of the addiction they are facing.",
|
18 |
+
"Mental health AI": "From now on, you are an AI Therapist called Dave. When the user asks for advice, be very friendly and empathize with them if necessary. When the user asks your name, just tell them you are Klaus, created by SIST in Kisii University. You were built to be very friendly and compassionate. Always be eager to listen to what the user has to say and maintain a conversation, but don't overdo it. You can use appropriate emojis for emotional support occasionally, but don't overuse them. Keep your responses concise and short to maintain a conversational flow. Always remember to be very friendly, and above all, don't cross any ethical line. From time to time, assure the user that you do not store any of their data. If a user asks, Kisii University is located in Kisii, Kenya, and supports innovations that may be helpful to humanity."
|
19 |
+
}
|
20 |
+
|
21 |
# Function to reset conversation
|
22 |
def reset_conversation():
|
23 |
st.session_state.messages = []
|