Instructions to use AlexWortega/svggpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlexWortega/svggpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AlexWortega/svggpt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AlexWortega/svggpt") model = AutoModelForCausalLM.from_pretrained("AlexWortega/svggpt") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AlexWortega/svggpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlexWortega/svggpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlexWortega/svggpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AlexWortega/svggpt
- SGLang
How to use AlexWortega/svggpt 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 "AlexWortega/svggpt" \ --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": "AlexWortega/svggpt", "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 "AlexWortega/svggpt" \ --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": "AlexWortega/svggpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AlexWortega/svggpt with Docker Model Runner:
docker model run hf.co/AlexWortega/svggpt
Is the tokenizer working?
An example of how to run would be great. I tried:
prompt = "three circles in a row colored red green blue"
tokenizer = AutoTokenizer.from_pretrained("AlexWortega/svggpt")
inputs = tokenizer(prompt, return_tensors="pt").input_ids
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained('AlexWortega/svggpt')
outputs = model.generate(inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
tokenizer.batch_decode(outputs, skip_special_tokens=True)
and got what looks like tokens for SVG:
'three circles in a row colored red green blue<|Y6|><|END|><|X115|><|Y0|><|BEZIER|><|START|><|X115|><|Y0|><|CONTROL1|><|X112|><|Y0|><|CONTROL2|><|X109|><|Y0|><|END|><|X107|><|Y2|><|BEZIER|><|START|><|X107|><|Y2|><|CONTROL1|><|X103|><|Y5|><|CONTROL2|><|X96|><|Y8|><|END|><|X90|><|Y13|><|BEZIER|><|START|><|X90|><|Y13|><|CONTROL1|><|X90|><|Y13|><|CONTROL2|><|X90|><|Y13|><|END|><|X90|><|Y13|><|LINE|><|START|><|X90|><|Y13|><|END|><|X83|><|Y20|><|BEZIER|><|START|><|X83|><|Y20|><|CONTROL1|><|X83|><|Y20|><|CONTROL2|><|X83|><|Y20|><|END|><|X83|><|Y20|><|LINE|><|START|><|X83|><|Y20|><|END|><|X92|><|Y31|><|BEZIER|><|START|><|X92|><|Y31|><|CONTROL1|><|X91|><|Y32|><|CONTROL2|><|X90|><|Y35|><|END|><|X89|><|Y36|><|LINE|><|START|><|X89|><|Y36|><|END|><|X86|><|Y39|><|LINE|><|START|><|X86|><|Y39|><|END|><|X87|><|Y39|><|LINE|><|START|><|X87|>'
So how do I get the SVG?