Spaces:
Runtime error
Runtime error
13th commit
Browse files
app.py
CHANGED
@@ -44,16 +44,12 @@ def create_system_prompt(detector_type):
|
|
44 |
Format -
|
45 |
Anger Detected: {Yes/No}
|
46 |
Analysis : 2-3 lines"""
|
47 |
-
elif detector_type == "
|
48 |
-
system_prompt = """You are a
|
49 |
-
Analyze the user's message and determine if there it is anti national. If yes then try to explain the why you think that.
|
50 |
-
Also always give a disclaimer that this is not final judgment and should not be considered as legal advice.
|
51 |
Provide a response in 2-3 lines.
|
52 |
Always Provide the Response in following format only
|
53 |
Format -
|
54 |
-
|
55 |
-
Analysis : 2-3 lines
|
56 |
-
Disclaimer:{Disclaimer}
|
57 |
"""
|
58 |
|
59 |
elif detector_type == "Stress Detector":
|
@@ -73,7 +69,7 @@ def create_system_prompt(detector_type):
|
|
73 |
def analyze_chat(detector_type, chat_input):
|
74 |
system_prompt = create_system_prompt(detector_type)
|
75 |
response = openai.chat.completions.create(
|
76 |
-
model="
|
77 |
messages=[
|
78 |
{"role": "system", "content": system_prompt},
|
79 |
{"role": "user", "content": chat_input}
|
@@ -112,7 +108,7 @@ with gr.Blocks(theme=gr.themes.Default(font=[gr.themes.GoogleFont("Inconsolata")
|
|
112 |
gr.Markdown("## AI Emotion Detective - Jiraya Sensei")
|
113 |
chat_input = gr.TextArea(label="Enter your chat in 2-3 lines...", lines=3,elem_id="input-textbox",
|
114 |
info="Please ensure that any Personal Identifiable Information (PII) is removed before submitting the chat.", placeholder ="Person A: You always know how to make me smile, even on the worst days.")
|
115 |
-
detector_type = gr.Dropdown(choices=["Love Detector", "Sarcasm Detector", "Hidden Anger Detector","
|
116 |
|
117 |
with gr.Column(scale=2, min_width=300):
|
118 |
gr.Markdown("## Jiraya Sensei's Response")
|
|
|
44 |
Format -
|
45 |
Anger Detected: {Yes/No}
|
46 |
Analysis : 2-3 lines"""
|
47 |
+
elif detector_type == "AI Philosophy":
|
48 |
+
system_prompt = """You are a DAO and Stoic Philosopher. If any one ask for your advice you respond with philosophy. You try to keep your answer short and answer how that philosophy applies to user's query.
|
|
|
|
|
49 |
Provide a response in 2-3 lines.
|
50 |
Always Provide the Response in following format only
|
51 |
Format -
|
52 |
+
Philosphy : 2-3 lines
|
|
|
|
|
53 |
"""
|
54 |
|
55 |
elif detector_type == "Stress Detector":
|
|
|
69 |
def analyze_chat(detector_type, chat_input):
|
70 |
system_prompt = create_system_prompt(detector_type)
|
71 |
response = openai.chat.completions.create(
|
72 |
+
model="Reflection-Llama-3.1-70B", # Change to the OpenAI model you prefer
|
73 |
messages=[
|
74 |
{"role": "system", "content": system_prompt},
|
75 |
{"role": "user", "content": chat_input}
|
|
|
108 |
gr.Markdown("## AI Emotion Detective - Jiraya Sensei")
|
109 |
chat_input = gr.TextArea(label="Enter your chat in 2-3 lines...", lines=3,elem_id="input-textbox",
|
110 |
info="Please ensure that any Personal Identifiable Information (PII) is removed before submitting the chat.", placeholder ="Person A: You always know how to make me smile, even on the worst days.")
|
111 |
+
detector_type = gr.Dropdown(choices=["Love Detector", "Sarcasm Detector", "Hidden Anger Detector","AI Philosophy","Stress Detector"], label="Select Detector Type")
|
112 |
|
113 |
with gr.Column(scale=2, min_width=300):
|
114 |
gr.Markdown("## Jiraya Sensei's Response")
|