Instructions to use starvector/starvector-1b-im2svg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use starvector/starvector-1b-im2svg with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("starvector/starvector-1b-im2svg", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Tensor size not matching
I keep meeting this error when running the script in model card.
Traceback (most recent call last):
File "test_starvec.py", line 22, in
raw_svg = starvector.generate_im2svg(batch, max_length=4000)[0]
File "starvector_arch.py", line 193, in generate_im2svg
return self.model.generate_im2svg(batch, **kwargs)
File "starvector_base.py", line 245, in generate_im2svg
inputs_embeds, attention_mask, prompt_tokens = self._prepare_generation_inputs(
File "starvector_base.py", line 208, in _prepare_generation_inputs
embedded_image = self.image_encoder(image)
File "torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "image_encoder.py", line 96, in forward
embeds = self.visual_encoder(image)
File "torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "clip_model.py", line 188, in forward
x = x + self.positional_embedding.to(x.dtype)
RuntimeError: The size of tensor a (16) must match the size of tensor b (1024) at non-singleton dimension 2