Instructions to use ebrahimzaher/qwen_adaptive_tutor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ebrahimzaher/qwen_adaptive_tutor with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("./qwen_base_model") model = PeftModel.from_pretrained(base_model, "ebrahimzaher/qwen_adaptive_tutor") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use ebrahimzaher/qwen_adaptive_tutor with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ebrahimzaher/qwen_adaptive_tutor to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ebrahimzaher/qwen_adaptive_tutor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ebrahimzaher/qwen_adaptive_tutor to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ebrahimzaher/qwen_adaptive_tutor", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,208 +1,54 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: unsloth/Qwen2.5-1.5B-Instruct
|
| 3 |
-
library_name: peft
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
-
- base_model:adapter:./qwen_base_model
|
| 7 |
-
- lora
|
| 8 |
-
- transformers
|
| 9 |
- unsloth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
## Model Details
|
| 19 |
|
| 20 |
### Model Description
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- **
|
| 27 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 28 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 29 |
-
- **Model type:** [More Information Needed]
|
| 30 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 31 |
-
- **License:** [More Information Needed]
|
| 32 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 33 |
-
|
| 34 |
-
### Model Sources [optional]
|
| 35 |
-
|
| 36 |
-
<!-- Provide the basic links for the model. -->
|
| 37 |
-
|
| 38 |
-
- **Repository:** [More Information Needed]
|
| 39 |
-
- **Paper [optional]:** [More Information Needed]
|
| 40 |
-
- **Demo [optional]:** [More Information Needed]
|
| 41 |
|
| 42 |
## Uses
|
| 43 |
|
| 44 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 45 |
-
|
| 46 |
### Direct Use
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Downstream Use [optional]
|
| 53 |
-
|
| 54 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
|
| 58 |
### Out-of-Scope Use
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
## Bias, Risks, and Limitations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 67 |
-
|
| 68 |
-
[More Information Needed]
|
| 69 |
-
|
| 70 |
-
### Recommendations
|
| 71 |
-
|
| 72 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 73 |
-
|
| 74 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 75 |
|
| 76 |
## How to Get Started with the Model
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
#
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
[More Information Needed]
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
#### Training Hyperparameters
|
| 100 |
-
|
| 101 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 102 |
-
|
| 103 |
-
#### Speeds, Sizes, Times [optional]
|
| 104 |
-
|
| 105 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 106 |
-
|
| 107 |
-
[More Information Needed]
|
| 108 |
-
|
| 109 |
-
## Evaluation
|
| 110 |
-
|
| 111 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 112 |
-
|
| 113 |
-
### Testing Data, Factors & Metrics
|
| 114 |
-
|
| 115 |
-
#### Testing Data
|
| 116 |
-
|
| 117 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Factors
|
| 122 |
-
|
| 123 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
#### Metrics
|
| 128 |
-
|
| 129 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 130 |
-
|
| 131 |
-
[More Information Needed]
|
| 132 |
-
|
| 133 |
-
### Results
|
| 134 |
-
|
| 135 |
-
[More Information Needed]
|
| 136 |
-
|
| 137 |
-
#### Summary
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## Model Examination [optional]
|
| 142 |
-
|
| 143 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 144 |
-
|
| 145 |
-
[More Information Needed]
|
| 146 |
-
|
| 147 |
-
## Environmental Impact
|
| 148 |
-
|
| 149 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 150 |
-
|
| 151 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 152 |
-
|
| 153 |
-
- **Hardware Type:** [More Information Needed]
|
| 154 |
-
- **Hours used:** [More Information Needed]
|
| 155 |
-
- **Cloud Provider:** [More Information Needed]
|
| 156 |
-
- **Compute Region:** [More Information Needed]
|
| 157 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 158 |
-
|
| 159 |
-
## Technical Specifications [optional]
|
| 160 |
-
|
| 161 |
-
### Model Architecture and Objective
|
| 162 |
-
|
| 163 |
-
[More Information Needed]
|
| 164 |
-
|
| 165 |
-
### Compute Infrastructure
|
| 166 |
-
|
| 167 |
-
[More Information Needed]
|
| 168 |
-
|
| 169 |
-
#### Hardware
|
| 170 |
-
|
| 171 |
-
[More Information Needed]
|
| 172 |
-
|
| 173 |
-
#### Software
|
| 174 |
-
|
| 175 |
-
[More Information Needed]
|
| 176 |
-
|
| 177 |
-
## Citation [optional]
|
| 178 |
-
|
| 179 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 180 |
-
|
| 181 |
-
**BibTeX:**
|
| 182 |
-
|
| 183 |
-
[More Information Needed]
|
| 184 |
-
|
| 185 |
-
**APA:**
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## Glossary [optional]
|
| 190 |
-
|
| 191 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 192 |
-
|
| 193 |
-
[More Information Needed]
|
| 194 |
-
|
| 195 |
-
## More Information [optional]
|
| 196 |
-
|
| 197 |
-
[More Information Needed]
|
| 198 |
-
|
| 199 |
-
## Model Card Authors [optional]
|
| 200 |
-
|
| 201 |
-
[More Information Needed]
|
| 202 |
-
|
| 203 |
-
## Model Card Contact
|
| 204 |
-
|
| 205 |
-
[More Information Needed]
|
| 206 |
-
### Framework versions
|
| 207 |
-
|
| 208 |
-
- PEFT 0.19.1
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
base_model: unsloth/Qwen2.5-1.5B-Instruct
|
|
|
|
|
|
|
| 4 |
tags:
|
|
|
|
|
|
|
|
|
|
| 5 |
- unsloth
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- conversational
|
| 9 |
+
- educational
|
| 10 |
+
- coding
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Qwen Adaptive Programming Tutor 🧑🏫
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
## Model Details
|
| 16 |
|
| 17 |
### Model Description
|
| 18 |
+
The **Qwen Adaptive Programming Tutor** is a fine-tuned language model designed to act as a Socratic programming instructor. Instead of providing direct solutions or writing code for the user, it analyzes buggy code and provides conceptual, encouraging hints to guide students toward the correct answer. This model was fine-tuned to reduce memory footprint and latency while maintaining high pedagogical quality.
|
| 19 |
|
| 20 |
+
- **Developed by:** Ebrahim Zaher
|
| 21 |
+
- **Model type:** Causal Language Model (LoRA Adapter)
|
| 22 |
+
- **Language(s) (NLP):** English
|
| 23 |
+
- **License:** Apache-2.0
|
| 24 |
+
- **Finetuned from model:** `unsloth/Qwen2.5-1.5B-Instruct`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Uses
|
| 27 |
|
|
|
|
|
|
|
| 28 |
### Direct Use
|
| 29 |
+
This model is intended to be used as a backend for educational technology platforms, coding bootcamps, and IDE extensions. It takes student code and an instruction as input and outputs a short, guiding question or hint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
### Out-of-Scope Use
|
| 32 |
+
- Generating full, production-ready code blocks (the model is explicitly trained *not* to do this).
|
| 33 |
+
- Replacing standard debugging tools for complex, multi-file enterprise codebases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
## How to Get Started with the Model
|
| 36 |
+
You can easily load this model using `transformers` and `peft`.
|
| 37 |
+
```python
|
| 38 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 39 |
+
from peft import PeftModel
|
| 40 |
+
|
| 41 |
+
# 1. Load the base model
|
| 42 |
+
base_model_name = "unsloth/Qwen2.5-1.5B-Instruct"
|
| 43 |
+
model = AutoModelForCausalLM.from_pretrained(base_model_name)
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
| 45 |
+
|
| 46 |
+
# 2. Load the LoRA adapter
|
| 47 |
+
adapter_repo = "ebrahimzaher/qwen_adaptive_tutor"
|
| 48 |
+
model = PeftModel.from_pretrained(model, adapter_repo)
|
| 49 |
+
|
| 50 |
+
# 3. Example usage
|
| 51 |
+
prompt = "<|im_start|>user\nAnalyze this buggy code and provide a Socratic hint:\ndef add(a, b):\n return a - b<|im_end|>\n<|im_start|>assistant\n"
|
| 52 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 53 |
+
outputs = model.generate(**inputs, max_new_tokens=128)
|
| 54 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|