star-vector icon indicating copy to clipboard operation
star-vector copied to clipboard

Incorrect second argument in `_get_generation_kwargs` call in `generate_text2svg`

Open HangyuRan opened this issue 7 months ago • 1 comments

Description: When using starvector.model.generate_text2svg() for text-to-SVG inference, the following line in starvector/model/models/starvector_base.py (around line 321) causes a runtime error:

generation_kwargs = self._get_generation_kwargs(
    {**kwargs, 'inputs_embeds': inputs_embeds, 'attention_mask': attention_mask},
    input_tokens.size(1)
)

This results in a TypeError: StarVectorBase._get_generation_kwargs() takes 2 positional arguments but 3 were given

Possible Fix: It seems to work if I remove the second argument and change the line to:

generation_kwargs = self._get_generation_kwargs({
    **kwargs,
    'inputs_embeds': inputs_embeds,
    'attention_mask': attention_mask
})

HangyuRan avatar May 20 '25 16:05 HangyuRan

But it always returns an empty answer on the 8b model

HangyuRan avatar May 20 '25 16:05 HangyuRan