Instructions to use maghrane/Qwen-0.8B-unsloth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use maghrane/Qwen-0.8B-unsloth with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B") model = PeftModel.from_pretrained(base_model, "maghrane/Qwen-0.8B-unsloth") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use maghrane/Qwen-0.8B-unsloth 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 maghrane/Qwen-0.8B-unsloth 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 maghrane/Qwen-0.8B-unsloth to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for maghrane/Qwen-0.8B-unsloth to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="maghrane/Qwen-0.8B-unsloth", max_seq_length=2048, )
Qwen-0.8B-unsloth π¦₯
A fine-tuned version of Qwen/Qwen3.5-0.8B optimized for instruction-following and technical Q&A regarding Unsloth AI documentation.
This model was trained using Supervised Fine-Tuning (SFT) with LoRA (Low-Rank Adaptation) and 4-bit quantization via bitsandbytes and Hugging Face's trl library.
π Model Details
- Developed by: maghrane
- Base Model:
Qwen/Qwen3.5-0.8B - Model Type: Causal Language Model (Decoder-Only)
- Fine-Tuning Technique: LoRA (PEFT) + QLoRA (4-bit NF4)
- Dataset: maghrane/unsloth-qwen
- Prompt Format:
<s>[INST] {prompt} [/INST] {response} </s> - License: Apache-2.0
βοΈ Training Hyperparameters & Configuration
πΉ LoRA Configuration (PEFT)
| Parameter | Value |
|---|---|
| LoRA Rank ($r$) | 64 |
| LoRA Alpha ($\alpha$) | 16 |
| LoRA Dropout | 0.1 |
| Bias | none |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, fc1, fc2 |
πΉ Quantization & Precision (BitsAndBytes)
| Parameter | Value |
|---|---|
| Quantization | 4-bit (nf4) |
| Compute Dtype | float16 |
| Double Quantization | False |
πΉ SFT Training Arguments
| Parameter | Value |
|---|---|
| Optimizer | paged_adamw_32bit |
| Learning Rate | 2e-4 |
| Learning Rate Scheduler | constant |
| Weight Decay | 0.001 |
| Warmup Ratio | 0.03 |
| Epochs | 1 |
| Per Device Batch Size | 4 |
| Gradient Accumulation | 1 |
| Max Gradient Norm | 0.3 |
π» How to Use & Run Inference
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# 1. Disable cuDNN algorithm search (resolves Qwen 3.5 1D convolution kernel lookup issue)
torch.backends.cudnn.enabled = False
base_model_name = "Qwen/Qwen3.5-0.8B"
adapter_model_name = "maghrane/Qwen-0.8B-unsloth"
# 2. Load Base Model & Adapter
tokenizer = AutoTokenizer.from_pretrained(base_model_name, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
model = PeftModel.from_pretrained(base_model, adapter_model_name)
# 3. Re-enable KV Cache & set to evaluation mode
model.config.use_cache = True
model.eval()
# 4. Generate Response
prompt = "What is Unsloth and what can it do?"
formatted_prompt = f"<s>[INST] {prompt} [/INST]"
inputs = tokenizer(formatted_prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.15,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id or tokenizer.eos_token_id
)
generated_text = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
print(generated_text)
π Results & Sample Inference
Input Prompt:
<s>[INST] What is Unsloth and what can it do? [/INST]
Model Output:
Unsloth lets you run and train AI models on your own local hardware via an open-source UI. It supports inference and training for 500+ models across text, audio, embedding, vision, and more. Key features include:
- Inference: Search, download, and run models (GGUFs, LoRA adapters, safetensors), self-healing tool calling, auto parameter tuning, model export, and side-by-side output comparison.
- Training: ~2x faster training with ~70% less VRAM, full/pre-training, 4-bit/16-bit/FP8 support, auto-dataset creation from PDF/CSV/DOCX, live observability, and efficient reinforcement learning (RL).
π Disclaimer
This model is fine-tuned for educational and documentation guidance purposes regarding local LLM fine-tuning and inference.
- Downloads last month
- -