CoolFace
Modelpublic

dghf77/Qwen2.5-3B-Instruct.Q5_spec_Dot_code_generation

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes11downloads
Model Card

Qwen2.5-3B-Instruct (LoRA DOT Fine-Tune, GGUF Q5)

A parameter-efficient fine-tune of Qwen2.5-3B-Instruct specialized for Graphviz DOT code generation. This model was trained with LoRA adapters and exported in GGUF Q5_K_M quantization for lightweight, portable inference.


๐Ÿ“Œ Model Summary

  • โ€”Base Model: Qwen2.5-3B-Instruct (bnb-4bit)
  • โ€”Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • โ€”Export Format: GGUF (llama.cpp-compatible)
  • โ€”Quantization: Q5KM (5-bit, medium precision)
  • โ€”File Size: 2.22 GB
  • โ€”License: Apache 2.0
  • โ€”Task: Natural language โ†’ Graphviz DOT code
  • โ€”Hosting: Hugging Face Hub

๐Ÿš€ Motivation

The base Qwen2.5-3B-Instruct model often produced:

  • โ€”โŒ Syntax errors (malformed nodes/edges, unclosed brackets, invalid attributes)
  • โ€”โŒ Hallucinated content (extra nodes/edges not in the prompt)

Fine-tuning with LoRA adapters on a curated dataset of 671 compiler-validated DOT examples resolved these issues, ensuring structurally valid DOT syntax generation.


๐Ÿ“‚ Training Details

  • โ€”Dataset Source: Graphviz Gallery (paired natural-language prompts + DOT code)
  • โ€”Validation: Every DOT sample compiled successfully before inclusion
  • โ€”Final Corpus: ~671 bug-free instruction/output pairs
  • โ€”Format: Alpaca-style JSON (train.jsonl, val.jsonl)
  • โ€”Trainer: Hugging Face trl.SFTTrainer
  • โ€”Environment: Google Colab GPU runtime

โš™๏ธ Technical Stack

  • โ€”Unsloth โ€“ optimized fine-tuning framework
  • โ€”Unsloth Zoo โ€“ pretrained configs + utilities
  • โ€”Tokenizer Utils โ€“ fixes for DOT-specific symbols
  • โ€”TRL โ€“ supervised fine-tuning trainer
  • โ€”Causal Convid + Mamba SSM โ€“ efficient sequence modeling for long DOT scripts
  • โ€”Ninja + shutil โ€“ build + file management utilities

๐Ÿ“ฆ Repository Contents

  • โ€”Qwen2.5-3B-Instruct.Q5_K_M.gguf (2.22 GB) โ€“ quantized model weights
  • โ€”README.md โ€“ model card
  • โ€”.gitattributes โ€“ LFS configuration

๐Ÿ–ฅ๏ธ Inference & Deployment

Compatible runtimes:

Example (llama.cpp CLI):

bash
./main -m Qwen2.5-3B-Instruct.Q5_K_M.gguf -p "Generate a DOT diagram for a binary tree"