Qwen3-8B-ToolUse

This repository contains a merged HuggingFace checkpoint for a tool-use / function-calling fine-tuned variant based on Qwen/Qwen3-8B.

Model Summary

  • Base model: Qwen/Qwen3-8B
  • Architecture: Qwen3ForCausalLM
  • Precision: bfloat16
  • Context length (config): max_position_embeddings = 40960
  • Weights format: sharded safetensors (4 shards)

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Yiwei6534/Qwen3-8B-ToolUse"

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What can you help me with?"},
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Tool Calling

This checkpoint ships a tool-calling chat template in chat_template.jinja. If your serving stack supports passing tools into the chat template, you can use it for structured function calling.

Generation Defaults

The bundled generation_config.json uses temperature=0.6, top_k=20, top_p=0.95. Adjust based on your deployment.

Integrity Files

  • FILE_MANIFEST.json: list of distributed files and their byte sizes.
  • SHA256SUMS.txt: SHA256 checksums for all distributed files (verify with sha256sum -c SHA256SUMS.txt).

Limitations

  • The model may hallucinate tool calls or produce invalid arguments.
  • Output quality depends on the serving template and tool schema formatting.
  • Safety, bias, and domain-specific failure modes are not fully documented here.

License

This repository uses license: other as a placeholder. Replace it with the correct license for the base model, your fine-tuning data, and your distribution terms before publishing.

Downloads last month
-
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for linglingdan/Qwen3-8B-ToolUse

Finetuned
Qwen/Qwen3-8B
Finetuned
(1721)
this model