Text-to-CadQuery-Qwen2.5-3B

Full-parameter supervised fine-tuned Qwen/Qwen2.5-3B-Instruct model for generating executable CadQuery Python programs from natural language CAD descriptions.

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "ricemonster/Text-to-CadQuery-Qwen2.5-3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.bfloat16, device_map="auto"
)

description = "A rectangular block with a centered cylindrical through-hole."
prompt = f"### Instruction:\n{description}\n\n### Response:\n"

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048, do_sample=False)
code = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(code)

Model Family

Size Model Base Model
Qwen2.5-0.5B ricemonster/Text-to-CadQuery-Qwen2.5-0.5B Qwen/Qwen2.5-0.5B-Instruct
Qwen2.5-1.5B ricemonster/Text-to-CadQuery-Qwen2.5-1.5B Qwen/Qwen2.5-1.5B-Instruct
Qwen2.5-3B ricemonster/Text-to-CadQuery-Qwen2.5-3B Qwen/Qwen2.5-3B-Instruct
Qwen2.5-7B ricemonster/Text-to-CadQuery-Qwen2.5-7B Qwen/Qwen2.5-7B-Instruct
Downloads last month
338
Safetensors
Model size
3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ricemonster/Text-to-CadQuery-Qwen2.5-3B

Base model

Qwen/Qwen2.5-3B
Finetuned
(1,728)
this model

Dataset used to train ricemonster/Text-to-CadQuery-Qwen2.5-3B

Collection including ricemonster/Text-to-CadQuery-Qwen2.5-3B