Views
No views yet
1Base Model: Qwen/Qwen3-4B-Instruct-2507
2Dataset: Salesforce/xlam-function-calling-60k (1K samples)
3Training Method: Supervised Fine-Tuning (SFT) with LoRA
4Batch Size: 6 (micro) × 3 (accumulation) = 18 (effective)
5Learning Rate: 2e-4 with cosine decay
6Sequence Length: 64 tokens (memory optimized)
7Precision: FP16 mixed precision
8Epochs: 8 (optimal for small dataset)
9Warmup Ratio: 5%| Metric | Value |
|---|---|
| Final Loss | 0.518 |
| Training Speed | 6.8 samples/sec |
| Total FLOPs | 2.13e+16 |
| GPU Efficiency | 98%+ utilization |
| Memory Usage | Optimized with gradient checkpointing |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4# Load model and tokenizer
5model_name = "sweatSmile/Qwen3-4B-Function-Calling-Pro"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype=torch.float16,
10 device_map="auto"
11)
12
13# Example function calling
14messages = [
15 {"role": "system", "content": "You are a helpful assistant with function calling capabilities."},
16 {"role": "user", "content": "What's the weather like in San Francisco and convert the temperature to Celsius?"}
17]
18
19# Generate response
20inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
21with torch.no_grad():
22 outputs = model.generate(inputs, max_new_tokens=200, temperature=0.7)
23
24response = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
25print(response)1@model{qwen3-4b-function-calling-pro,
2 title={Qwen3-4B-Function-Calling-Pro: Specialized Function Calling Model},
3 author={sweatSmile},
4 year={2025},
5 url={https://huggingface.co/sweatSmile/Qwen3-4B-Function-Calling-Pro}
6}