This is a fine-tuned version of Gemma 3N specifically optimized for conducting trauma assessments with children from conflict zones. The model is designed to facilitate empathetic, culturally-sensitive conversations and generate professional psychological reports.
-
Dataset and Training Script:
Details about training script and datast curation can be found here:
https://github.com/Dahimi/Gemma3n_Finetune_Child_Trauma
-
Fine-tuning Configuration:
- Batch Size: 1 with gradient accumulation (4 steps)
- Learning Rate: 2e-4 with linear scheduler
- Training Focus: Conversation responses only (loss masked on user inputs)
- LoRA Parameters: r=16, alpha=16
- Context Length: 2048 tokens
-
Conversational Assessment:
- Empathetic dialogue with parents/caregivers
- Culturally-appropriate questioning
- Trauma indicator identification
-
Report Generation:
- Structured professional assessments
- Severity scoring (1-10 scale)
- Risk indicator analysis
- Cultural context documentation
Data format follows Gemma's chat template with alternating roles.
1from transformers import TextStreamer
2from unsloth import FastModel
3
4model, tokenizer = FastModel.from_pretrained(
5 "SoufianeDahimi/child_trauma_gemma_finetune",
6 max_seq_length = 2048,
7 load_in_4bit = True,
8)
9
10def generate_response(prompt):
11 messages = [{
12 "role": "user",
13 "content": [{"type": "text", "text": prompt}]
14 }]
15 inputs = tokenizer.apply_chat_template(
16 messages,
17 add_generation_prompt = True,
18 return_tensors = "pt",
19 tokenize = True,
20 return_dict = True,
21 ).to("cuda")
22
23 return model.generate(
24 **inputs,
25 max_new_tokens = 512,
26 temperature = 0.7,
27 top_p = 0.95,
28 top_k = 64,
29 streamer = TextStreamer(tokenizer, skip_prompt = True),
30 )
-
Conversational Responses:
- Empathetic dialogue
- Follow-up questions
- Guidance and support
-
Assessment Reports:
- Parent observations summary
- Trauma indicator analysis
- Severity scoring
- Risk assessment
- Cultural context notes
This model is designed for sensitive mental health contexts and should be used with appropriate care: