Views
No views yet
⚠️ ALPHA / RESEARCH PREVIEW — NOT PRODUCTION READYThis is alpha work. It is not production ready. This model is published as a starting point for people who want to get into the business of model training. The output quality is inconsistent, and you should expect broken or malformed SVGs. Treat this as an educational/demo artifact — not something to ship.
| Prompt | Generated SVG |
|---|---|
star | ![]() |
calendar | ![]() |
car | ![]() |
heart | ![]() |
rocket | ![]() |
house | ![]() |
animal | ![]() |
pip install torch transformers safetensors deepsvg cairosvg1from huggingface_hub import hf_hub_download
2import torch
3from transformers import AutoTokenizer
4
5# Download model files
6model_path = hf_hub_download("m1357l/iconshop-svg-generator", "model.safetensors")
7config_path = hf_hub_download("m1357l/iconshop-svg-generator", "config.json")
8word_emb_path = hf_hub_download("m1357l/iconshop-svg-generator", "word_embedding_512.pt")
9
10# Load model
11from model.decoder import SketchDecoder
12import json
13
14with open(config_path) as f:
15 config = json.load(f)
16
17tokenizer = AutoTokenizer.from_pretrained("google/bert_uncased_L-12_H-512_A-8")
18
19model = SketchDecoder(
20 config={
21 'hidden_dim': config['hidden_dim'],
22 'embed_dim': config['embed_dim'],
23 'num_layers': config['num_layers'],
24 'num_heads': config['num_heads'],
25 'dropout_rate': config['dropout_rate'],
26 },
27 pix_len=config['pix_len'],
28 text_len=config['text_len'],
29 num_text_token=tokenizer.vocab_size,
30 word_emb_path=word_emb_path,
31 pos_emb_path=config['pos_emb_path'],
32)
33
34# Load weights
35from safetensors.torch import load_file
36state_dict = load_file(model_path)
37model.load_state_dict(state_dict, strict=False)
38model.eval()1# Single prompt
2python model_card.py --output ./samples --prompts "star"
3
4# Multiple prompts
5python model_card.py --output ./samples --prompts "star" "calendar" "car"