Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4# Load base model
5base_model = AutoModelForCausalLM.from_pretrained(
6 "dnotitia/Smoothie-Qwen3-30B-A3B",
7 torch_dtype="auto",
8 device_map="auto",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("dnotitia/Smoothie-Qwen3-30B-A3B")
12
13# Load LoRA adapter
14model = PeftModel.from_pretrained(
15 base_model,
16 "developer-lunark/Smoothie-Qwen3-30B-General-Roleplay-LoRA"
17)
18
19# Generate
20messages = [{"role": "user", "content": "안녕하세요!"}]
21inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
22outputs = model.generate(inputs, max_new_tokens=256)
23print(tokenizer.decode(outputs[0], skip_special_tokens=True))1python -m vllm.entrypoints.openai.api_server \
2 --model dnotitia/Smoothie-Qwen3-30B-A3B \
3 --enable-lora \
4 --lora-modules "roleplay-lora=developer-lunark/Smoothie-Qwen3-30B-General-Roleplay-LoRA" \
5 --max-lora-rank 32 \
6 --tensor-parallel-size 2 \
7 --gpu-memory-utilization 0.85| Parameter | Value |
|---|---|
| Base Model | dnotitia/Smoothie-Qwen3-30B-A3B |
| Training Method | SFT (Supervised Fine-Tuning) |
| Precision | bfloat16 |
| Learning Rate | 1e-4 |
| LR Scheduler | Cosine |
| Warmup Ratio | 0.03 |
| Weight Decay | 0.01 |
| Batch Size | 4 (per device) |
| Gradient Accumulation | 8 |
| Effective Batch Size | 32 |
| Epochs | 1 |
| Total Steps | 857 |
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 32 |
| LoRA Alpha | 64 |
| LoRA Dropout | 0.05 |
| Target Modules | q_proj, k_proj, v_proj, o_proj |
| Task Type | CAUSAL_LM |
1@misc{smoothie-qwen3-30b-roleplay-lora,
2 title={Smoothie-Qwen3-30B-General-Roleplay-LoRA},
3 author={developer-lunark},
4 year={2024},
5 publisher={Hugging Face},
6 url={https://huggingface.co/developer-lunark/Smoothie-Qwen3-30B-General-Roleplay-LoRA}
7}1@misc{vonwerra2022trl,
2 title={{TRL: Transformer Reinforcement Learning}},
3 author={Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
4 year={2020},
5 journal={GitHub repository},
6 publisher={GitHub},
7 howpublished={\url{https://github.com/huggingface/trl}}
8}