Text Generation
Transformers
Safetensors
English
qwen3
code-generation
svg
fine-tuned
fp16
vllm
merged
conversational
text-generation-inference
Instructions to use amkyawdev/svg-code-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amkyawdev/svg-code-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amkyawdev/svg-code-generator") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("amkyawdev/svg-code-generator") model = AutoModelForCausalLM.from_pretrained("amkyawdev/svg-code-generator") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amkyawdev/svg-code-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amkyawdev/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": "amkyawdev/svg-code-generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amkyawdev/svg-code-generator
- SGLang
How to use amkyawdev/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 "amkyawdev/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": "amkyawdev/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 "amkyawdev/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": "amkyawdev/svg-code-generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amkyawdev/svg-code-generator with Docker Model Runner:
docker model run hf.co/amkyawdev/svg-code-generator
| license: apache-2.0 | |
| base_model: qwen3-0.6B | |
| tags: | |
| - code-generation | |
| - svg | |
| - fine-tuned | |
| - fp16 | |
| - vllm | |
| - merged | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| model_type: qwen | |
| inference: true | |
| torch_dtype: float16 | |
| widget: | |
| - example_title: "Simple Circle" | |
| text: "Create a red circle" | |
| - example_title: "Rectangle with Border" | |
| text: "Draw a blue rectangle with black border" | |
| - example_title: "Complex Shape" | |
| text: "Generate a star with 5 points in yellow" | |
| # SVG Code Generator | |
| This is a fine-tuned model for generating SVG code from natural language descriptions. The model has been merged with the base model weights and optimized in fp16 format. | |
| ## Model Details | |
| - **Model Name**: model_v15 | |
| - **Base Model**: qwen3-0.6B | |
| - **Training Method**: Fine-tuning with merged weights | |
| - **Task**: Text-to-SVG code generation | |
| - **Model Type**: Merged Qwen model | |
| - **Precision**: fp16 | |
| - **Library**: Transformers, vLLM compatible | |
| - **Format**: Merged model (not adapter-based) | |
| ## Usage | |
| ### With Transformers | |
| Load the model directly using the transformers library: | |
| ```python | |
| # Load base model and tokenizer | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| tokenizer = AutoTokenizer.from_pretrained("vinoku89/svg-code-generator") | |
| model = AutoModelForCausalLM.from_pretrained("vinoku89/svg-code-generator") | |
| # Generate SVG code | |
| prompt = "Create a blue circle with radius 50" | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| # Generate with parameters | |
| outputs = model.generate( | |
| **inputs, | |
| max_length=200, | |
| temperature=0.7, | |
| do_sample=True, | |
| pad_token_id=tokenizer.eos_token_id | |
| ) | |
| # Decode the generated SVG code | |
| generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True) | |
| svg_code = generated_text[len(prompt):].strip() | |
| print("Generated SVG:") | |
| print(svg_code) | |
| ``` | |
| ### With vLLM | |
| This model supports vLLM for high-performance inference in fp16 format. | |
| ## Training Data | |
| The model was trained on SVG code generation tasks with natural language descriptions. | |
| ## Intended Use | |
| This model is designed to generate SVG code from text descriptions for educational and creative purposes. | |
| ## Limitations | |
| - Generated SVG may require validation | |
| - Performance depends on prompt clarity | |
| - Limited to SVG syntax and features seen during training | |
| ## Model Performance | |
| The model has been fine-tuned specifically for SVG generation tasks with merged weights for optimal performance. | |
| ## Technical Details | |
| - **Precision**: fp16 for memory efficiency | |
| - **Compatibility**: vLLM supported for high-throughput inference | |
| - **Architecture**: Merged fine-tuned weights (no adapters required) | |