rq-vae-transformer icon indicating copy to clipboard operation
rq-vae-transformer copied to clipboard

make it safer input argument type check in sampling method

Open wbaek opened this issue 2 years ago • 1 comments

In my case, during T2I sampling

In the part of declaring the following variable When using as int type like this

top_k=1024
top_p=1

I met the following error message:

object of type 'int' has no len()

wbaek avatar Mar 25 '22 09:03 wbaek

This is indeed better and LGTM, but this will break the scripts when they are parsing topk, topp from config, in particular: https://github.com/kakaobrain/rq-vae-transformer/blob/c3de514d7c832f63eff333833b456c53a342e8c0/main_sampling_fid.py#L72-L76 https://github.com/kakaobrain/rq-vae-transformer/blob/c3de514d7c832f63eff333833b456c53a342e8c0/main_sampling_txt2img.py#L70-L74

This is due to that args.topk, args.topp is to be omegaconf.ListConfig and when passed to the method sample, type checking will cause error. So we would need a fix in those scripts to convert ListConfig into list or tuple.

chiheonk avatar Mar 25 '22 10:03 chiheonk