Downloads · 30 days
0
sweatSmile/Qwen3-4B-Function-Calling-Pro
Qwen3-4B-Function-Calling-Pro is a text classification model from sweatSmile. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
Fine-tuned Qwen3-4B-Instruct specialized for function calling and tool usage
Downloads · 30 days
0
Access
Public
Updated Aug 23, 2025
Parameters
4B
16.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors16.2 GB · 98%
From the Hugging Face model README
Fine-tuned Qwen3-4B-Instruct specialized for function calling and tool usage
This model is a fine-tuned version of Qwen/Qwen3-4B-Instruct-2507 trained specifically for function calling tasks using the Salesforce/xlam-function-calling-60k dataset.
The model demonstrates exceptional capability in understanding user queries, selecting appropriate tools, and generating accurate function calls with proper parameters.
Base Model: Qwen/Qwen3-4B-Instruct-2507
Dataset: Salesforce/xlam-function-calling-60k (1K samples)
Training Method: Supervised Fine-Tuning (SFT) with LoRA
Batch Size: 6 (micro) × 3 (accumulation) = 18 (effective)
Learning Rate: 2e-4 with cosine decay
Sequence Length: 64 tokens (memory optimized)
Precision: FP16 mixed precision
Epochs: 8 (optimal for small dataset)
Warmup Ratio: 5%
The model achieved impressive training metrics demonstrating professional ML engineering practices:
| 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 |
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
model_name = "sweatSmile/Qwen3-4B-Function-Calling-Pro"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# Example function calling
messages = [
{"role": "system", "content": "You are a helpful assistant with function calling capabilities."},
{"role": "user", "content": "What's the weather like in San Francisco and convert the temperature to Celsius?"}
]
# Generate response
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(inputs, max_new_tokens=200, temperature=0.7)
response = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(response)
@model{qwen3-4b-function-calling-pro,
title={Qwen3-4B-Function-Calling-Pro: Specialized Function Calling Model},
author={sweatSmile},
year={2025},
url={https://huggingface.co/sweatSmile/Qwen3-4B-Function-Calling-Pro}
}
This model is released under the same license as the base Qwen3-4B-Instruct model. Please refer to the original model's license for usage terms.
Built with ❤️ by sweatSmile | Fine-tuned on high-quality function calling data