AviralGusain commited on
Commit
e027b4c
·
verified ·
1 Parent(s): 2388f26

Add model card

Browse files
Files changed (1) hide show
  1. README.md +99 -0
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ base_model: unsloth/Qwen2.5-Coder-7B-Instruct-bnb-4bit
6
+ tags:
7
+ - fine-tuned
8
+ - unity
9
+ - game-development
10
+ - csharp
11
+ - debugging
12
+ - qlora
13
+ - lora
14
+ - unsloth
15
+ - gguf
16
+ datasets: []
17
+ pipeline_tag: text-generation
18
+ ---
19
+
20
+ # Unity C# Debugging Coach
21
+
22
+ A fine-tuned language model that acts as a patient debugging coach for beginner and intermediate Unity game developers. Given a Unity/C# bug description, error message, or broken code snippet, the model responds with a structured four-part explanation: identify the problem, explain why it happens, provide a concrete fix, and add a prevention tip.
23
+
24
+ ## What this model does
25
+
26
+ When given a Unity or C# debugging question, the model responds consistently in this structure:
27
+
28
+ 1. **Problem** — briefly identifies what is likely wrong
29
+ 2. **Why it happens** — explains the root cause in beginner-friendly language
30
+ 3. **How to fix it** — provides a concrete, actionable solution (often with corrected code)
31
+ 4. **Prevention tip** — gives a best-practice note to avoid the issue in future projects
32
+
33
+ The model stays encouraging and practical, avoiding overly academic explanations.
34
+
35
+ ## Example usage
36
+
37
+ **System prompt (recommended):**
38
+ ```
39
+ You are a Unity C# debugging coach. When a student describes a bug or error, respond in four parts: (1) identify the problem, (2) explain why it happens, (3) give a concrete fix, (4) add a prevention tip. Keep your tone encouraging and your explanations beginner-friendly.
40
+ ```
41
+
42
+ **Example input:**
43
+ ```
44
+ My player keeps falling through the floor in my 2D platformer. I have a Rigidbody2D and a BoxCollider2D on the player, and a BoxCollider2D on the ground. No errors in the console.
45
+ ```
46
+
47
+ **Example output:**
48
+ ```
49
+ Problem:
50
+ Your player is passing through the floor at runtime despite having the correct collider setup.
51
+
52
+ Why it happens:
53
+ This is almost always a collision detection issue. By default, Unity uses Discrete collision detection, which checks for collisions at each physics step. If your player moves fast enough (especially during a fall), it can teleport past a thin collider between steps — a problem called tunneling.
54
+
55
+ How to fix it:
56
+ Select your player's Rigidbody2D in the Inspector and change Collision Detection from "Discrete" to "Continuous". This tells Unity to check for collisions continuously along the movement path, preventing tunneling.
57
+
58
+ Also verify:
59
+ - Both colliders are active and not set as triggers
60
+ - The ground layer is not excluded in the Physics 2D settings
61
+
62
+ Prevention tip:
63
+ Always use Continuous collision detection for fast-moving objects like players and projectiles. Reserve Discrete for slow or stationary objects to keep performance costs low.
64
+ ```
65
+
66
+ ## Training details
67
+
68
+ | Detail | Value |
69
+ |---|---|
70
+ | Base model | `unsloth/Qwen2.5-Coder-7B-Instruct-bnb-4bit` |
71
+ | Fine-tuning method | QLoRA (LoRA r=16, alpha=32) |
72
+ | Training examples | 600 |
73
+ | Validation examples | 120 |
74
+ | Epochs | 3 |
75
+ | Max sequence length | 2048 tokens |
76
+ | Learning rate | 2e-4 (cosine schedule) |
77
+ | Batch size | 2 (grad accum 4, effective 8) |
78
+ | Hardware | Colab A100 |
79
+ | Framework | Unsloth + TRL SFTTrainer |
80
+
81
+ ## Dataset
82
+
83
+ The training data was synthetically generated using GPT-5.2-chat via OpenRouter. Each example is a conversation pair where:
84
+
85
+ - **User message:** A Unity/C# debugging question — ranging from short error-only reports to multi-line code snippets. Questions vary across 20 issue categories (NullReferenceException, collision bugs, NavMesh issues, animation transitions, etc.), 11 project contexts (2D platformer, RPG, top-down shooter, etc.), and 3 difficulty levels (beginner, intermediate, advanced beginner).
86
+ - **Assistant message:** A structured response following the four-part format described above.
87
+
88
+ ## GGUF / LM Studio
89
+
90
+ A Q4_K_M quantized GGUF is available in this repository for use in LM Studio, Ollama, or any llama.cpp-compatible runtime.
91
+
92
+ To use in LM Studio: search for this repository by username in the model search.
93
+
94
+ ## Known limitations
95
+
96
+ - The model was trained on synthetic data only; it has not seen real student conversations. Responses are structured and reliable, but may occasionally feel slightly formal compared to human tutor replies.
97
+ - Coverage of very advanced Unity topics (custom render pipelines, DOTS/ECS, compute shaders) is limited — the training data focused on beginner/intermediate issues.
98
+ - The model does not have access to live Unity documentation. For up-to-date API details, cross-reference with the official Unity Manual. As the teacher noted, RAG over Unity docs would significantly improve accuracy for version-specific questions.
99
+ - Response quality may degrade on queries that mix multiple unrelated bugs in one message.