51 lines
1.4 KiB
Markdown
51 lines
1.4 KiB
Markdown
|
|
---
|
||
|
|
license: apache-2.0
|
||
|
|
base_model: Qwen/Qwen3-4B-Base
|
||
|
|
tags:
|
||
|
|
- qwen3
|
||
|
|
- code
|
||
|
|
- sft
|
||
|
|
- lora
|
||
|
|
- lora-merged
|
||
|
|
- think
|
||
|
|
language:
|
||
|
|
- en
|
||
|
|
- zh
|
||
|
|
library_name: transformers
|
||
|
|
pipeline_tag: text-generation
|
||
|
|
---
|
||
|
|
|
||
|
|
# Qwen3-4B Code SFT - Think Baseline (LoRA Merged)
|
||
|
|
|
||
|
|
LoRA supervised fine-tuning of [Qwen/Qwen3-4B-Base](https://huggingface.co/Qwen/Qwen3-4B-Base), with adapters **merged into full weights** for direct inference.
|
||
|
|
|
||
|
|
**This repo is LoRA-based SFT (rank 64), not full-parameter fine-tuning.** For native full SFT weights, see [modrill/qwen3-4b-think-baseline-full-sft](https://huggingface.co/modrill/qwen3-4b-think-baseline-full-sft).
|
||
|
|
|
||
|
|
## Model Details
|
||
|
|
|
||
|
|
- **Base model:** Qwen/Qwen3-4B-Base
|
||
|
|
- **Fine-tuning:** LoRA SFT (rank 64, alpha 128), merged into full weights
|
||
|
|
- **Mode:** Think (`enable_thinking=true`)
|
||
|
|
- **Training cutoff length:** 24576 tokens
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
```python
|
||
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||
|
|
|
||
|
|
model_id = "modrill/qwen3-4b-think-baseline-lora-sft"
|
||
|
|
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
||
|
|
model = AutoModelForCausalLM.from_pretrained(
|
||
|
|
model_id, trust_remote_code=True, torch_dtype="auto", device_map="auto"
|
||
|
|
)
|
||
|
|
```
|
||
|
|
|
||
|
|
## Inference Tips
|
||
|
|
|
||
|
|
- Set `enable_thinking=true` in chat template
|
||
|
|
- Recommended `max_tokens`: 24576
|
||
|
|
|
||
|
|
## License
|
||
|
|
|
||
|
|
Apache 2.0, consistent with the Qwen3 base model license.
|