Instructions to use leafstudiosDot/incotel-hanny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use leafstudiosDot/incotel-hanny with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "leafstudiosDot/incotel-hanny") - Notebooks
- Google Colab
- Kaggle
Hanny 4B chat adapter (M5 SFT)
A LoRA adapter for Qwen/Qwen3.5-4B, trained through that model's own chat template with loss on assistant tokens only. It is a public experiment, not a general-purpose assistant.
What this is
- Base model:
Qwen/Qwen3.5-4B - Adapter weights
sha256[:16]:039a77ffa53a4d42(85.0 MB) - LoRA r=16, alpha=32, targets: o_proj, up_proj, down_proj, k_proj, v_proj, q_proj, gate_proj
- Run:
m5-4b-ddp| precision: 4-bit nf4 | chat template:a4aee8afcf2e0711 - Optimizer steps: 250 (best at 250) | tokens processed: 871,734
- Distributed: DDP across 2 GPUs (
torch.distributed.run); the effective batch is the per-GPU batch times 2.
Training data
| source | split | rows | licence |
|---|---|---|---|
allenai/tulu-3-sft-mixture |
train | 40000 | odc-by |
HuggingFaceH4/ultrachat_200k |
train_sft | 40000 | mit |
Rows read: 80000; conversations kept: 79999; training examples: 161208; duplicates removed: 1.
One example is produced per assistant turn, so the context is repeated across turns of the same conversation.
Evaluation
Held-out assistant-token loss on held-out conversations, measured before and after training in the same process at the same precision:
| loss | |
|---|---|
| base | 1.4139 +- 0.0671 |
| adapter (best) | 1.0698 |
| improvement (before - after) | 0.3441 (paired se 0.0308) |
Both numbers come from the same run at the same precision, and the difference is paired item-by-item, so it is the tighter comparison. This is not comparable with any fp16 number in the producing repository; 4-bit quantisation itself costs ~0.09 nats.
The M5 gate (chateval.py) scored 15 chat pairs and reported a paired chat-loss change of +0.0473 +- 0.0372 (positive = the adapter's loss is lower). That change is within 2x its paired standard error, so it is inconclusive on this probe set, not evidence of an improvement. The gate process completed (exit 0).
That probe set is a smoke test, not a measurement, and the script says so on every run. Refusal p-values: {"harmful": 1.0, "benign": 1.0}.
Use
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained('Qwen/Qwen3.5-4B')
base = AutoModelForCausalLM.from_pretrained('Qwen/Qwen3.5-4B', dtype='float16', device_map='auto')
model = PeftModel.from_pretrained(base, 'YOUR-NAME/adapter-repo')
model.eval()
messages = [{'role': 'user', 'content': 'Hello'}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True,
return_tensors='pt', enable_thinking=False)
out = model.generate(ids, max_new_tokens=256, do_sample=True,
temperature=0.7, top_p=0.9)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
Limitations
Qwen/Qwen3.5-4Bis a small model. Fine-tuning changes behaviour; it does not add knowledge the base model lacks.- This is not a ChatGPT- or Claude-class assistant, and no amount of further LoRA training on this base will make it one.
- Refusal behaviour is not guaranteed. The gate is a 15-pair / 26-probe smoke test and cannot certify safety.
- Generation settings used during development: temperature 0.7, top_p 0.9, top_k 20, thinking off. Different settings are a different model behaviour.
Provenance and rights
- Provenance class: public-mix. Trained only on Hub datasets, listed in the card. Check each dataset's licence before publishing.
- The publisher states: Trained only on allenai/tulu-3-sft-mixture (ODC-BY) and HuggingFaceH4/ultrachat_200k (MIT); no private code or user data was used. The publisher does not relicense the underlying datasets; attribution is in this card.
- Downloads last month
- 6