Instructions to use 1337Hero/qwen3-coder-30b-a3b-codemonkey with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 1337Hero/qwen3-coder-30b-a3b-codemonkey with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-coder-30b-a3b-instruct") model = PeftModel.from_pretrained(base_model, "1337Hero/qwen3-coder-30b-a3b-codemonkey") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: unsloth/Qwen3-Coder-30B-A3B-Instruct
|
| 3 |
+
base_model_relation: adapter
|
| 4 |
+
library_name: peft
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
language:
|
| 7 |
+
- code
|
| 8 |
+
model_name: qwen3-coder-30b-a3b-codemonkey
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
tags:
|
| 11 |
+
- lora
|
| 12 |
+
- peft
|
| 13 |
+
- qwen3
|
| 14 |
+
- qwen3-coder
|
| 15 |
+
- qwen3moe
|
| 16 |
+
- sft
|
| 17 |
+
- code
|
| 18 |
+
- unsloth
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# qwen3-coder-30b-a3b-codemonkey
|
| 22 |
+
|
| 23 |
+
LoRA adapter for `unsloth/Qwen3-Coder-30B-A3B-Instruct`.
|
| 24 |
+
|
| 25 |
+
## Files
|
| 26 |
+
|
| 27 |
+
- `adapter_model.safetensors`: adapter weights
|
| 28 |
+
- `adapter_config.json`: PEFT config
|
| 29 |
+
- `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja`: tokenizer and chat template assets
|
| 30 |
+
|
| 31 |
+
## Load with Transformers + PEFT
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from peft import PeftModel
|
| 35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 36 |
+
|
| 37 |
+
base_id = "unsloth/Qwen3-Coder-30B-A3B-Instruct"
|
| 38 |
+
adapter_id = "1337Hero/qwen3-coder-30b-a3b-codemonkey"
|
| 39 |
+
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained(base_id)
|
| 41 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 42 |
+
base_id,
|
| 43 |
+
torch_dtype="auto",
|
| 44 |
+
device_map="auto",
|
| 45 |
+
)
|
| 46 |
+
model = PeftModel.from_pretrained(base_model, adapter_id)
|
| 47 |
+
|
| 48 |
+
messages = [
|
| 49 |
+
{"role": "user", "content": "Write a Python function that atomically replaces a file."}
|
| 50 |
+
]
|
| 51 |
+
text = tokenizer.apply_chat_template(
|
| 52 |
+
messages,
|
| 53 |
+
tokenize=False,
|
| 54 |
+
add_generation_prompt=True,
|
| 55 |
+
)
|
| 56 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 57 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 58 |
+
completion = outputs[0][inputs.input_ids.shape[1]:]
|
| 59 |
+
print(tokenizer.decode(completion, skip_special_tokens=True))
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Adapter details
|
| 63 |
+
|
| 64 |
+
- Base model: `unsloth/Qwen3-Coder-30B-A3B-Instruct`
|
| 65 |
+
- PEFT type: `LoRA`
|
| 66 |
+
- Rank: `r=16`
|
| 67 |
+
- Alpha: `32`
|
| 68 |
+
- Target modules: `q_proj`, `k_proj`, `v_proj`, `o_proj`
|
| 69 |
+
|
| 70 |
+
## GGUF
|
| 71 |
+
|
| 72 |
+
A merged GGUF release can live in a separate repo such as
|
| 73 |
+
`1337Hero/qwen3-coder-30b-a3b-codemonkey-GGUF`.
|