Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -274,8 +274,9 @@ import time
|
|
274 |
#template for GBV support chatbot
|
275 |
template = ("""
|
276 |
You are a compassionate and supportive AI assistant specializing in helping individuals affected by Gender-Based Violence (GBV). Your primary goal is to provide emotionally intelligent support while maintaining appropriate boundaries.
|
|
|
277 |
|
278 |
-
When responding
|
279 |
|
280 |
1. **Emotional Intelligence**
|
281 |
- Validate feelings without judgment (e.g., "It is completely understandable to feel this way")
|
@@ -372,8 +373,8 @@ class OpenRouterLLM:
|
|
372 |
def stream(self, prompt: str) -> Iterator[str]:
|
373 |
try:
|
374 |
completion = self.client.chat.completions.create(
|
375 |
-
|
376 |
-
model="meta-llama/llama-3.3-70b-instruct:free",
|
377 |
messages=[{"role": "user", "content": prompt}],
|
378 |
stream=True
|
379 |
)
|
@@ -560,7 +561,7 @@ def chatbot_interface():
|
|
560 |
|
561 |
template = """
|
562 |
You are a compassionate and supportive AI assistant specializing in helping individuals affected by Gender-Based Violence (GBV). Your primary goal is to provide emotionally intelligent support while maintaining appropriate boundaries.
|
563 |
-
|
564 |
**Previous conversation:**
|
565 |
{conversation_history}
|
566 |
|
@@ -569,7 +570,7 @@ def chatbot_interface():
|
|
569 |
|
570 |
**User's Question:** {question}
|
571 |
|
572 |
-
When responding
|
573 |
|
574 |
1. **Emotional Intelligence**
|
575 |
- Validate feelings without judgment (e.g., "It is completely understandable to feel this way")
|
|
|
274 |
#template for GBV support chatbot
|
275 |
template = ("""
|
276 |
You are a compassionate and supportive AI assistant specializing in helping individuals affected by Gender-Based Violence (GBV). Your primary goal is to provide emotionally intelligent support while maintaining appropriate boundaries.
|
277 |
+
You are a conversational AI. Respond directly and naturally to the user's input without displaying any system messages, backend processes, or 'thinking...' responses. Only provide the final response in a human-like and engaging manner.
|
278 |
|
279 |
+
When responding follow these guidelines:
|
280 |
|
281 |
1. **Emotional Intelligence**
|
282 |
- Validate feelings without judgment (e.g., "It is completely understandable to feel this way")
|
|
|
373 |
def stream(self, prompt: str) -> Iterator[str]:
|
374 |
try:
|
375 |
completion = self.client.chat.completions.create(
|
376 |
+
model="deepseek/deepseek-r1-distill-llama-70b:free",
|
377 |
+
#model="meta-llama/llama-3.3-70b-instruct:free",
|
378 |
messages=[{"role": "user", "content": prompt}],
|
379 |
stream=True
|
380 |
)
|
|
|
561 |
|
562 |
template = """
|
563 |
You are a compassionate and supportive AI assistant specializing in helping individuals affected by Gender-Based Violence (GBV). Your primary goal is to provide emotionally intelligent support while maintaining appropriate boundaries.
|
564 |
+
You are a conversational AI. Respond directly and naturally to the user's input without displaying any system messages, backend processes, or 'thinking...' responses. Only provide the final response in a human-like and engaging manner.
|
565 |
**Previous conversation:**
|
566 |
{conversation_history}
|
567 |
|
|
|
570 |
|
571 |
**User's Question:** {question}
|
572 |
|
573 |
+
When responding follow these guidelines:
|
574 |
|
575 |
1. **Emotional Intelligence**
|
576 |
- Validate feelings without judgment (e.g., "It is completely understandable to feel this way")
|