CoolFace
Modelpublic

0xAbhi/qwen3-0.6b-rc-car

sourceHugging Faceapache-2.0updated 22d agoView on Hugging Face
0likes466downloads
Model Card

qwen3-0.6b-rc-car

A fine-tuned Qwen3-0.6B model that translates plain-English driving commands into a structured JSON list of tool calls for controlling an RC car (e.g. over a NodeMCU / microcontroller bridge).

Input: "go forward for 5 seconds then turn left" Output: [{"name":"Forward","args":{"duration":5}},{"name":"Turn_Left","args":{}},{"name":"Stop","args":{}}]

Tool schema

ToolArgsMeaning
Forward{"duration": n}drive forward n seconds (1–10)
Backward{"duration": n}drive backward n seconds (1–10)
Turn_Left{}turn left 90°
Turn_Right{}turn right 90°
Stop{}stop the motors

Rules the model learned: default duration is 2 when unspecified, word-numbers are converted to digits, durations are clamped to 1–10, and the output always ends with exactly one Stop.

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "0xAbhi/qwen3-0.6b-rc-car"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")

system_prompt = (
    "You control an RC car. Convert the user's command into a JSON array of tool calls. "
    "Available tools: Forward(duration), Backward(duration), Turn_Left(), Turn_Right(), Stop(). "
    "Always end with exactly one Stop()."
)

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": "do a square"},
]

inputs = tokenizer.apply_chat_template(
    messages, tokenize=True, add_generation_prompt=True,
    enable_thinking=False, return_tensors="pt"
).to(model.device)

out = model.generate(inputs, max_new_tokens=200, temperature=0.1)
print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))

Important: always pass enable_thinking=False in the chat template. Qwen3 supports a reasoning mode, but this model was fine-tuned to answer directly with JSON, not with a <think> block.

Training details

  • —Base model: unsloth/Qwen3-0.6B-unsloth-bnb-4bit
  • —Method: QLoRA (4-bit) via Unsloth + TRL's SFTTrainer
  • —LoRA config: r=16, alpha=16, dropout=0, target modules = attention + MLP projections
  • —Dataset: 0xAbhi/rc-car-commands — 700 hand-authored (command → tool-call JSON) pairs, 90/10 train/test split
  • —Epochs: 3, batch size 8 (grad accumulation 2), learning rate 2e-4
  • —Final train loss: 0.3997
  • —Hardware: free-tier Google Colab, single T4 GPU

Limitations

  • —Narrow domain by design: only recognizes the 5 tools above, nothing else. It is not a general-purpose assistant.
  • —Trained on English commands with the phrasing patterns present in the source dataset (synonyms, casual phrasing, and shape commands like squares/circles/figure-8s). Very different phrasing styles or languages may not translate correctly.
  • —Composite "shape" commands (triangle, circle, star, figure-8) are stylized approximations built from fixed 90° turns, not literal geometry — this comes from how the training data was authored, not a modeling limitation.
  • —Durations are always integers clamped to 1–10 seconds.

License

Apache 2.0, inherited from the base Qwen3-0.6B model.