Text Generation
Transformers
Safetensors
English
qwen3
code-generation
svg
fine-tuned
fp16
vllm
merged
conversational
text-generation-inference
Instructions to use vinoku89/svg-code-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vinoku89/svg-code-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vinoku89/svg-code-generator") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vinoku89/svg-code-generator") model = AutoModelForCausalLM.from_pretrained("vinoku89/svg-code-generator", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vinoku89/svg-code-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vinoku89/svg-code-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vinoku89/svg-code-generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vinoku89/svg-code-generator
- SGLang
How to use vinoku89/svg-code-generator 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 "vinoku89/svg-code-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vinoku89/svg-code-generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "vinoku89/svg-code-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vinoku89/svg-code-generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vinoku89/svg-code-generator with Docker Model Runner:
docker model run hf.co/vinoku89/svg-code-generator
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,23 +1,16 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
-
base_model:
|
| 4 |
tags:
|
| 5 |
- code-generation
|
| 6 |
- svg
|
| 7 |
- lora
|
| 8 |
- fine-tuned
|
| 9 |
- peft
|
| 10 |
-
- graphics
|
| 11 |
-
- art
|
| 12 |
language:
|
| 13 |
- en
|
| 14 |
pipeline_tag: text-generation
|
| 15 |
-
library_name:
|
| 16 |
-
datasets:
|
| 17 |
-
- custom-svg-dataset
|
| 18 |
-
metrics:
|
| 19 |
-
- bleu
|
| 20 |
-
- rouge
|
| 21 |
model_type: lora
|
| 22 |
inference: true
|
| 23 |
widget:
|
|
@@ -27,19 +20,6 @@ widget:
|
|
| 27 |
text: "Draw a blue rectangle with black border"
|
| 28 |
- example_title: "Complex Shape"
|
| 29 |
text: "Generate a star with 5 points in yellow"
|
| 30 |
-
model-index:
|
| 31 |
-
- name: svg-code-generator
|
| 32 |
-
results:
|
| 33 |
-
- task:
|
| 34 |
-
type: text-generation
|
| 35 |
-
name: SVG Code Generation
|
| 36 |
-
metrics:
|
| 37 |
-
- type: bleu
|
| 38 |
-
value: 0.85
|
| 39 |
-
name: BLEU Score
|
| 40 |
-
- type: rouge
|
| 41 |
-
value: 0.78
|
| 42 |
-
name: ROUGE Score
|
| 43 |
---
|
| 44 |
|
| 45 |
# SVG Code Generator
|
|
@@ -49,12 +29,11 @@ This is a fine-tuned LoRA adapter for generating SVG code from natural language
|
|
| 49 |
## Model Details
|
| 50 |
|
| 51 |
- **Model Name**: model_v10
|
| 52 |
-
- **Base Model**:
|
| 53 |
- **Training Method**: LoRA (Low-Rank Adaptation)
|
| 54 |
- **Task**: Text-to-SVG code generation
|
| 55 |
- **Model Type**: Causal Language Model with LoRA adapter
|
| 56 |
-
- **
|
| 57 |
-
- **Training Framework**: PyTorch with PEFT
|
| 58 |
|
| 59 |
## Usage
|
| 60 |
|
|
@@ -62,41 +41,18 @@ Load the model using the transformers library and PEFT for LoRA adapters. Use na
|
|
| 62 |
|
| 63 |
## Training Data
|
| 64 |
|
| 65 |
-
The model was trained on SVG code generation tasks with natural language descriptions
|
| 66 |
-
- Basic shapes (circles, rectangles, polygons)
|
| 67 |
-
- Complex graphics and patterns
|
| 68 |
-
- Color specifications and styling
|
| 69 |
-
- Positioning and sizing instructions
|
| 70 |
|
| 71 |
## Intended Use
|
| 72 |
|
| 73 |
-
This model is designed to generate SVG code from text descriptions for
|
| 74 |
-
- Educational purposes
|
| 75 |
-
- Creative projects
|
| 76 |
-
- Rapid prototyping of graphics
|
| 77 |
-
- Learning SVG syntax
|
| 78 |
|
| 79 |
## Limitations
|
| 80 |
|
| 81 |
- Generated SVG may require validation
|
| 82 |
- Performance depends on prompt clarity
|
| 83 |
- Limited to SVG syntax and features seen during training
|
| 84 |
-
- May not handle very complex geometric calculations
|
| 85 |
|
| 86 |
## Model Performance
|
| 87 |
|
| 88 |
-
The model has been fine-tuned specifically for SVG generation tasks and
|
| 89 |
-
- BLEU Score: 0.85
|
| 90 |
-
- ROUGE Score: 0.78
|
| 91 |
-
- High accuracy on basic shapes and common patterns
|
| 92 |
-
|
| 93 |
-
## Citation
|
| 94 |
-
|
| 95 |
-
If you use this model, please cite:
|
| 96 |
-
@misc{svg-code-generator,
|
| 97 |
-
title={SVG Code Generator},
|
| 98 |
-
author={Your Name},
|
| 99 |
-
year={2025},
|
| 100 |
-
publisher={HuggingFace},
|
| 101 |
-
url={https://huggingface.co/your_username/svg-code-generator}
|
| 102 |
-
}
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model: qwen3-0.6B
|
| 4 |
tags:
|
| 5 |
- code-generation
|
| 6 |
- svg
|
| 7 |
- lora
|
| 8 |
- fine-tuned
|
| 9 |
- peft
|
|
|
|
|
|
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
+
library_name: transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
model_type: lora
|
| 15 |
inference: true
|
| 16 |
widget:
|
|
|
|
| 20 |
text: "Draw a blue rectangle with black border"
|
| 21 |
- example_title: "Complex Shape"
|
| 22 |
text: "Generate a star with 5 points in yellow"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
---
|
| 24 |
|
| 25 |
# SVG Code Generator
|
|
|
|
| 29 |
## Model Details
|
| 30 |
|
| 31 |
- **Model Name**: model_v10
|
| 32 |
+
- **Base Model**: qwen3-0.6B
|
| 33 |
- **Training Method**: LoRA (Low-Rank Adaptation)
|
| 34 |
- **Task**: Text-to-SVG code generation
|
| 35 |
- **Model Type**: Causal Language Model with LoRA adapter
|
| 36 |
+
- **Library**: Transformers
|
|
|
|
| 37 |
|
| 38 |
## Usage
|
| 39 |
|
|
|
|
| 41 |
|
| 42 |
## Training Data
|
| 43 |
|
| 44 |
+
The model was trained on SVG code generation tasks with natural language descriptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
## Intended Use
|
| 47 |
|
| 48 |
+
This model is designed to generate SVG code from text descriptions for educational and creative purposes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
## Limitations
|
| 51 |
|
| 52 |
- Generated SVG may require validation
|
| 53 |
- Performance depends on prompt clarity
|
| 54 |
- Limited to SVG syntax and features seen during training
|
|
|
|
| 55 |
|
| 56 |
## Model Performance
|
| 57 |
|
| 58 |
+
The model has been fine-tuned specifically for SVG generation tasks and should be used within this domain for best results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|