Instructions to use ying2022/qwen3-6-35b-xlam-tools-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ying2022/qwen3-6-35b-xlam-tools-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-35B-A3B") model = PeftModel.from_pretrained(base_model, "ying2022/qwen3-6-35b-xlam-tools-lora") - Notebooks
- Google Colab
- Kaggle
Initial upload: Qwen3.6-35B-A3B xLAM Function-Calling LoRA
Browse files- README.md +60 -0
- adapter_config.json +26 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.6-35B-A3B
|
| 4 |
+
tags:
|
| 5 |
+
- lora
|
| 6 |
+
- peft
|
| 7 |
+
- qwen
|
| 8 |
+
- qwen3
|
| 9 |
+
- function-calling
|
| 10 |
+
- tool-use
|
| 11 |
+
- xlam
|
| 12 |
+
datasets:
|
| 13 |
+
- minpeter/xlam-function-calling-60k-parsed
|
| 14 |
+
library_name: peft
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Qwen3.6-35B-A3B xLAM Function-Calling LoRA
|
| 18 |
+
|
| 19 |
+
A LoRA adapter fine-tuned on `minpeter/xlam-function-calling-60k-parsed` from the `Qwen/Qwen3.6-35B-A3B` base model.
|
| 20 |
+
|
| 21 |
+
## Training configuration
|
| 22 |
+
|
| 23 |
+
- **Method:** LoRA (bf16)
|
| 24 |
+
- **LoRA rank (r):** 64
|
| 25 |
+
- **LoRA alpha:** 128
|
| 26 |
+
- **Dataset:** minpeter/xlam-function-calling-60k-parsed
|
| 27 |
+
- **Infrastructure:** NVIDIA Run:AI on Amazon SageMaker HyperPod (EKS mode)
|
| 28 |
+
|
| 29 |
+
## Usage with transformers + peft
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 33 |
+
from peft import PeftModel
|
| 34 |
+
import torch
|
| 35 |
+
|
| 36 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 37 |
+
"Qwen/Qwen3.6-35B-A3B",
|
| 38 |
+
torch_dtype=torch.bfloat16,
|
| 39 |
+
device_map="auto",
|
| 40 |
+
)
|
| 41 |
+
model = PeftModel.from_pretrained(base, "ying2022/qwen3-6-35b-xlam-tools-lora")
|
| 42 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-35B-A3B")
|
| 43 |
+
|
| 44 |
+
messages = [{"role": "user", "content": "<your prompt here>"}]
|
| 45 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
|
| 46 |
+
outputs = model.generate(inputs, max_new_tokens=500, temperature=0.3)
|
| 47 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Serving with vLLM
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
vllm serve Qwen/Qwen3.6-35B-A3B \
|
| 54 |
+
--enable-lora \
|
| 55 |
+
--lora-modules adapter=ying2022/qwen3-6-35b-xlam-tools-lora \
|
| 56 |
+
--max-loras 1 --max-lora-rank 64 \
|
| 57 |
+
--tensor-parallel-size 2 \
|
| 58 |
+
--gpu-memory-utilization 0.90 \
|
| 59 |
+
--max-model-len 4096
|
| 60 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"peft_type": "LORA",
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "Qwen/Qwen3.6-35B-A3B",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"fan_in_fan_out": false,
|
| 7 |
+
"inference_mode": true,
|
| 8 |
+
"init_lora_weights": true,
|
| 9 |
+
"lora_alpha": 128,
|
| 10 |
+
"lora_dropout": 0.0,
|
| 11 |
+
"modules_to_save": null,
|
| 12 |
+
"r": 64,
|
| 13 |
+
"rank_pattern": {},
|
| 14 |
+
"alpha_pattern": {},
|
| 15 |
+
"target_modules": [
|
| 16 |
+
"k_proj",
|
| 17 |
+
"o_proj",
|
| 18 |
+
"proj",
|
| 19 |
+
"q_proj",
|
| 20 |
+
"qkv",
|
| 21 |
+
"v_proj"
|
| 22 |
+
],
|
| 23 |
+
"task_type": "CAUSAL_LM",
|
| 24 |
+
"use_dora": false,
|
| 25 |
+
"use_rslora": false
|
| 26 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45e93de80a9b1db532d4d64f148203298854ea60d628fe67525083f05fef3bee
|
| 3 |
+
size 108358512
|