Text Generation
Transformers
Safetensors
English
svg
text-to-svg
qwen2
qlora
lora
fine-tuning
code-generation
Instructions to use kaleidoscopicwhether/svg-gen-weights with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaleidoscopicwhether/svg-gen-weights with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kaleidoscopicwhether/svg-gen-weights")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kaleidoscopicwhether/svg-gen-weights", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kaleidoscopicwhether/svg-gen-weights with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaleidoscopicwhether/svg-gen-weights" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaleidoscopicwhether/svg-gen-weights", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kaleidoscopicwhether/svg-gen-weights
- SGLang
How to use kaleidoscopicwhether/svg-gen-weights with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "kaleidoscopicwhether/svg-gen-weights" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaleidoscopicwhether/svg-gen-weights", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "kaleidoscopicwhether/svg-gen-weights" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaleidoscopicwhether/svg-gen-weights", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kaleidoscopicwhether/svg-gen-weights with Docker Model Runner:
docker model run hf.co/kaleidoscopicwhether/svg-gen-weights
|
Download README.md from kaleidoscopicwhether/svg-gen-weights: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/kaleidoscopicwhether/svg-gen-weights/resolve/main/README.md
- Command line
-
hf download hf://kaleidoscopicwhether/svg-gen-weights/README.md
-
curl -L -o README.md https://huggingface.co/kaleidoscopicwhether/svg-gen-weights/resolve/main/README.md
2.72 kB
| language: | |
| - en | |
| license: mit | |
| tags: | |
| - svg | |
| - text-to-svg | |
| - qwen2 | |
| - qlora | |
| - lora | |
| - fine-tuning | |
| - code-generation | |
| base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # SVG Generation Model Weights | |
| Model weights for the DL Spring 2026 Kaggle Competition — Text-to-SVG Generation. | |
| **Author:** Ivan Aristy (NYU Tandon, CS-GY 9223 / ECE-GY 7123) | |
| **Base Model:** [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) | |
| **Best Public Score:** 16.87 / 100 | |
| **GitHub:** [ivanearisty/svg-gen](https://github.com/ivanearisty/svg-gen) | |
| ## Models | |
| | Model | Type | Public Score | Description | | |
| |---|---|---|---| | |
| | [componly-r32-adapter](./componly-r32-adapter) | LoRA adapter | **16.87** | **Best model.** Requires `merged-1.5b-r16` as base. LoRA r=32, alpha=64, trained on 45k competition-only samples. | | |
| | [merged-1.5b-r16](./merged-1.5b-r16) | Full model | — | Qwen2.5-Coder-1.5B with Round 1 LoRA r=16 adapter permanently merged into weights. Base for the best adapter. | | |
| | [refined-7000](./refined-7000) | Full model | 16.26 | Full fine-tune from merged base, checkpoint 7000, CE loss 0.308. Standalone model. | | |
| | [r16-3epoch](./r16-3epoch) | LoRA adapter | 15.47 | Round 1 adapter. LoRA r=16, 3 epochs on 46k competition data. Load on `Qwen/Qwen2.5-Coder-1.5B-Instruct`. | | |
| | [mixed-r32-adapter](./mixed-r32-adapter) | LoRA adapter | 14.64 | LoRA r=32, trained on 76k mixed data (competition + external). External data hurt performance. | | |
| | [codegen-1.5b](./codegen-1.5b) | Full model | 12.26 | Code generation experiment — model outputs Python code instead of raw SVG. | | |
| ## Training Strategy | |
| We use an iterative **merge-and-retrain** approach: | |
| 1. **Round 1:** LoRA r=16 on Qwen2.5-Coder-1.5B (46k competition data, 3 epochs) | |
| 2. **Merge** adapter into base weights | |
| 3. **Round 2:** Fresh LoRA r=32 on merged base (45k competition data, 2 epochs) — **best model** | |
| 4. **Round 3:** Merge Round 2 adapter, full fine-tune on DGX Spark | |
| ## Key Findings | |
| - **System prompt is critical:** Removing it drops score from 53.8 to 18.8 (local ablation) | |
| - **Less is more:** Minimal system prompt ("Output valid SVG code only.") outperforms verbose prompts | |
| - **LoRA > Full fine-tune:** Despite lower CE loss, full fine-tuning scores worse than LoRA | |
| - **Competition data only:** External datasets (SVGX, OmniSVG) degraded performance | |
| - **Greedy decoding optimal:** Any sampling or penalty variation hurts structured SVG output | |
| ## Hardware | |
| - **Training (QLoRA):** NVIDIA RTX 2000 Ada (16GB VRAM) | |
| - **Training (Full FT):** NVIDIA DGX Spark (128GB unified memory) | |
| - **Inference:** RTX 2000 Ada, 4-bit quantized, ~20s per SVG | |