Nedimark commited on
Commit
04659be
·
verified ·
1 Parent(s): 1aebbf1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +116 -43
README.md CHANGED
@@ -1,20 +1,49 @@
1
- # Canis.teach — Qwen3‑4B Instruct (Science)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  LoRA adapters for the Science tutor in the Canis.teach suite.
4
 
5
- - Base: Qwen/Qwen3-4B-Instruct-2507
6
- - Release: CanisAI/teach-science-qwen3-4b-2507-r1
7
- - Project: Canis.teach, Learning that fits.
8
- - Tags: canis-teach, qwen3, education, lora, transformers
9
 
10
  ## What is this?
11
 
12
- This repository provides LoRA adapters finetuned on Science tutoring dialogues. Apply these adapters to the base model to enable subjectaware, didactic behavior without downloading a full merged checkpoint.
13
 
14
- For a ready‑to‑run merged model or an Ollama‑friendly GGUF build, see “Related.”
15
 
16
- ## Usage (LoRA)
17
 
 
 
 
 
 
 
 
 
18
  ```python
19
  from transformers import AutoTokenizer, AutoModelForCausalLM
20
  from peft import PeftModel
@@ -22,58 +51,102 @@ from peft import PeftModel
22
  base = "Qwen/Qwen3-4B-Instruct-2507"
23
  adapter = "CanisAI/teach-science-qwen3-4b-2507-r1"
24
 
25
- tok = AutoTokenizer.from_pretrained(base, use_fast=True)
26
- model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
 
 
 
 
27
  model = PeftModel.from_pretrained(model, adapter)
28
 
 
29
  prompt = "Briefly compare mitosis and meiosis: purpose, divisions, chromosome number, variation."
30
- inputs = tok(prompt, return_tensors="pt").to(model.device)
31
- out = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.8, top_k=20)
32
- print(tok.decode(out[0], skip_special_tokens=True))
 
 
 
 
 
 
 
33
  ```
34
 
35
- Recommended decoding (for instruct‑style usage):
36
- - temperature ≈ 0.7
37
- - top_p 0.8
38
- - top_k 20
39
- Adjust as needed.
 
 
 
 
 
 
40
 
41
- ## Dataset & training
 
 
 
42
 
43
- - Data: Canis.lab‑generated Science tutoring dialogues
44
- - Method: SFT with TRL; LoRA on Transformer projection layers (Unsloth + PEFT)
45
- - Goal: Clear, step‑by‑step pedagogy and helpful hints across subjects
46
 
47
- ## Intended use
 
 
 
 
 
48
 
49
- - Subject‑aware tutoring for Science with didactic, step‑by‑step responses.
50
- - Suitable for educational prototypes, demonstrations, and research.
51
- - Built to “teach, not just answer”: stepwise hints, clarity, and rubric‑aligned structure.
52
 
53
- ## Safety and limitations
 
 
 
 
54
 
55
- - Human oversight is required. The model may hallucinate or oversimplify.
56
- - For fact‑heavy tasks, consider Retrieval‑Augmented Generation (RAG) with curriculum sources.
57
- - Follow data privacy and compliance rules in your environment (e.g., school policies).
58
 
59
- ## Related
 
 
 
 
 
60
 
61
- - LoRA adapters (lightweight):
62
- - CanisAI/teach-science-qwen3-4b-2507-r1
63
- - Quantized GGUF for Ollama/llama.cpp:
64
- - CanisAI/teach-science-qwen3-4b-2507-r1-gguf
65
- - Base model:
66
- - Qwen/Qwen3-4B-Instruct-2507
 
 
67
 
68
  ## License
69
 
70
- - Inherits the base model’s license. Review the base model terms before use.
71
- - Dataset licensing and any third‑party assets should be respected accordingly.
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  ## Acknowledgments
74
 
75
- - Qwen3 by Qwen team
76
- - Unsloth, TRL, PEFT, and Transformers for training/serving
77
- - Educators and contributors supporting Canis.teach
 
78
 
79
- Learning that fits.
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ base_model:
6
+ - Qwen/Qwen3-4B-Instruct-2507
7
+ base_model_relation: adapter
8
+ library_name: peft
9
+ tags:
10
+ - canis-teach
11
+ - qwen3
12
+ - education
13
+ - lora
14
+ - transformers
15
+ - science
16
+ - tutoring
17
+ pipeline_tag: text-generation
18
+ datasets:
19
+ - CanisAI/teach-science-v1
20
+ ---
21
+
22
+ # Canis.teach - Qwen3-4B Instruct (Science)
23
 
24
  LoRA adapters for the Science tutor in the Canis.teach suite.
25
 
26
+ - **Base Model**: Qwen/Qwen3-4B-Instruct-2507
27
+ - **Release**: CanisAI/teach-science-qwen3-4b-2507-r1
28
+ - **Project**: Canis.teach - Learning that fits.
29
+ - **Subject**: Science
30
 
31
  ## What is this?
32
 
33
+ This repository provides LoRA adapters fine-tuned on Science tutoring dialogues. Apply these adapters to the base model to enable subject-aware, didactic behavior without downloading a full merged checkpoint.
34
 
35
+ The model is designed to **teach, not just answer** - providing step-by-step explanations, hints, and pedagogically structured responses.
36
 
37
+ For ready-to-run merged models or Ollama-friendly GGUF quantizations, see the "Related Models" section.
38
 
39
+ ## Quick Start
40
+
41
+ ### Installation
42
+ ```bash
43
+ pip install transformers peft torch
44
+ ```
45
+
46
+ ### Usage (LoRA)
47
  ```python
48
  from transformers import AutoTokenizer, AutoModelForCausalLM
49
  from peft import PeftModel
 
51
  base = "Qwen/Qwen3-4B-Instruct-2507"
52
  adapter = "CanisAI/teach-science-qwen3-4b-2507-r1"
53
 
54
+ tokenizer = AutoTokenizer.from_pretrained(base, use_fast=True)
55
+ model = AutoModelForCausalLM.from_pretrained(
56
+ base,
57
+ device_map="auto",
58
+ torch_dtype="auto"
59
+ )
60
  model = PeftModel.from_pretrained(model, adapter)
61
 
62
+ # Example prompt
63
  prompt = "Briefly compare mitosis and meiosis: purpose, divisions, chromosome number, variation."
64
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
65
+ outputs = model.generate(
66
+ **inputs,
67
+ max_new_tokens=256,
68
+ temperature=0.7,
69
+ top_p=0.8,
70
+ top_k=20,
71
+ do_sample=True
72
+ )
73
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
74
  ```
75
 
76
+ ## Training Details
77
+
78
+ - **Base Model**: Qwen/Qwen3-4B-Instruct-2507
79
+ - **Training Method**: Supervised Fine-Tuning (SFT) with LoRA
80
+ - **Framework**: Unsloth + TRL/PEFT
81
+ - **Data**: Canis.lab-curated Science tutoring dialogues
82
+ - **Target Modules**: Query, Key, Value, Output projections
83
+ - **Rank**: 16
84
+ - **Alpha**: 32
85
+
86
+ ## Intended Use
87
 
88
+ - **Primary**: Subject-aware tutoring for Science education
89
+ - **Applications**: Educational prototypes, tutoring systems, research
90
+ - **Approach**: Stepwise explanations, pedagogical hints, rubric-aligned responses
91
+ - **Target Audience**: Students, educators, researchers
92
 
93
+ ## Model Behavior
 
 
94
 
95
+ The model is optimized for:
96
+ - Clear, step-by-step explanations
97
+ - Appropriate difficulty progression
98
+ - Encouraging learning through hints rather than direct answers
99
+ - Subject-specific pedagogical approaches
100
+ - Maintaining educational standards and accuracy
101
 
102
+ ## Recommended Settings
 
 
103
 
104
+ For optimal tutoring behavior:
105
+ - **Temperature**: 0.6-0.8
106
+ - **Top-p**: 0.8-0.9
107
+ - **Top-k**: 20-40
108
+ - **Max tokens**: 256-512 (depending on complexity)
109
 
110
+ ## Safety and Limitations
 
 
111
 
112
+ **Important Considerations**:
113
+ - Human oversight required for educational use
114
+ - May occasionally hallucinate or oversimplify complex topics
115
+ - For fact-critical applications, consider RAG with verified curriculum sources
116
+ - Follow your institution's data privacy and AI usage policies
117
+ - Not a replacement for qualified human instruction
118
 
119
+ ## Related Models
120
+
121
+ | Type | Repository | Description |
122
+ |------|------------|-------------|
123
+ | **LoRA Adapters** | `CanisAI/teach-science-qwen3-4b-2507-r1` | This repository (lightweight) |
124
+ | **Merged Model** | `CanisAI/teach-science-qwen3-4b-2507-r1-merged` | Ready-to-use full model |
125
+ | **GGUF Quantized** | `CanisAI/teach-science-qwen3-4b-2507-r1-gguf` | Ollama/llama.cpp compatible |
126
+ | **Dataset** | `CanisAI/teach-science-v1` | Training data |
127
 
128
  ## License
129
 
130
+ This model inherits the license from the base model (Qwen/Qwen3-4B-Instruct-2507). Please review the base model's license terms before use.
131
+
132
+ ## Citation
133
+
134
+ ```bibtex
135
+ @misc{canis-teach-science,
136
+ title={Canis.teach Science Tutor},
137
+ author={CanisAI},
138
+ year={2025},
139
+ publisher={Hugging Face},
140
+ howpublished={\url{https://huggingface.co/CanisAI/teach-science-qwen3-4b-2507-r1}}
141
+ }
142
+ ```
143
 
144
  ## Acknowledgments
145
 
146
+ - **Qwen Team** for the excellent base model
147
+ - **Unsloth** for efficient training tools
148
+ - **Hugging Face** ecosystem (Transformers, PEFT, TRL)
149
+ - Educators and contributors supporting the Canis.teach project
150
 
151
+ ---
152
+ **Canis.teach** - Learning that fits.