--- language: en license: mit tags: - mental-health - therapy - llm - conversational datasets: - fadodr/mental_health_therapy base_model: - Qwen/Qwen2.5-3B --- # Dia Mental Health Assistant Dia is a compassionate mental health therapy assistant designed to provide supportive guidance on mental health topics. It responds with empathy and care, using GenZ expressions to connect authentically with users. ## Model Description This model is fine-tuned to: - Provide empathetic responses to mental health concerns - Use GenZ language to connect with users - Keep responses concise and relevant - Ask thoughtful questions to understand feelings better - Prioritize emotional wellbeing ## Usage ```python import torch from unsloth import FastLanguageModel from transformers import TextStreamer # Load model and tokenizer with Unsloth model_name = "petrioteer/dia50-2e" model, tokenizer = FastLanguageModel.from_pretrained( model_name=model_name, max_seq_length=2048, load_in_4bit=True, device_map="auto", ) # Enable faster inference FastLanguageModel.for_inference(model) # Create a text streamer for continuous output text_streamer = TextStreamer(tokenizer) # Define the prompt template dia_prompt = """You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise and directly relevant to the user's input. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences. ### Instruction: {} ### Input: {} ### Response: """ def chat_with_dia(user_input, system_prompt="You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise (2-3 sentences) and directly relevant to the user's specific question or concern. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences."): # Format the input using the same template as training inputs = tokenizer( [ dia_prompt.format( system_prompt, # instruction user_input, # input ) ], return_tensors="pt" ).to("cuda" if torch.cuda.is_available() else "cpu") # Generate response with streaming print("\nDia is responding...") _ = model.generate( **inputs, streamer=text_streamer, max_new_tokens=512, temperature=0.74, top_p=0.9, do_sample=True, ) print("\n") # Simple chat loop if __name__ == "__main__": print("Welcome to Dia Chat! (Type 'exit' to quit)") print("=" * 99) while True: user_input = input("\nYou: ") if user_input.lower() in ["exit", "quit", "bye"]: print("Dia: Goodbye! Take care of yourself!") break chat_with_dia(user_input) ``` ## Model Limitations - This model is designed specifically for mental health support conversations and may not perform well on other topics - It is not a replacement for professional mental health services - The model may occasionally generate responses that sound like medical advice despite being instructed not to - The model's understanding of GenZ language is limited to its training data ## Ethical Considerations This model is intended to provide emotional support only and should not be used as a substitute for professional mental health care. Users should be made aware of the limitations of AI-based support systems.