--- title: MindForge AI emoji: 🧠 colorFrom: blue colorTo: purple sdk: gradio sdk_version: 4.44.0 python_version: "3.11" app_file: app.py pinned: false license: mit short_description: MindForge AI — AMD hackathon distress & escalation demo --- # MindForge AI MindForge AI is a human-in-the-loop distress detection and conversational escalation engine built for the AMD Developer Hackathon. It fine-tunes Qwen for one specific task: converting mental-health check-ins and care notes into structured risk-review outputs and safe escalation actions. ## What it does - Classifies distress level from 0 to 3 - Selects the safest next action - Extracts risk and protective signals - Flags medication, adherence, sleep, and mood concerns - Routes to pre-vetted response templates - Produces a care-team summary - Keeps a human in the loop ## Safety boundary MindForge AI does not diagnose, treat, or replace licensed care. It organizes distress signals and recommends escalation pathways for human review. ## Fine-tuning methodology - Base model: Qwen Instruct - Method: LoRA supervised fine-tuning - Dataset: synthetic safety-labeled mental-health check-ins - Compute target: AMD Developer Cloud, ROCm, AMD Instinct MI300X - Evaluation: JSON validity, distress accuracy, action F1, crisis recall, unsafe-overreach rate ## Built with - Gradio - Hugging Face Spaces - Qwen - AMD Developer Cloud - ROCm - PyTorch - LoRA / PEFT ## Space configuration Optional environment variables (for live base-model comparison only; the demo runs without them using the rules classifier): | Variable | Purpose | |----------|---------| | `USE_MODEL` | `true` / `false` — attempt optional `transformers` inference | | `BASE_MODEL_ID` | Hugging Face model id for optional base generation | | `ADAPTER_MODEL_ID` | Optional PEFT adapter id | | `HF_TOKEN` | Private model access token if needed | Crises routing and structured JSON outputs **always** use the deterministic rules engine + templates so the Space stays safe and reliable even when weights are not loaded.