if cfg_scale > 0.:
un_x = x.clone()
un_x[:, :prompt.shape[1]] = dim
Should we rely on prompt.shape[1] to determine the prompt length, given that prompts can be of variable length? Or would it be better to use a different way to compute the prompt length?
Here - https://github.com/ML-GSAI/SMDM/blob/583aa4716d17728dbb825aec6c24a121164d616a/eval/gen_model_answer.py#L88C17-L88C48
In this snippet:
Should we rely on prompt.shape[1] to determine the prompt length, given that prompts can be of variable length? Or would it be better to use a different way to compute the prompt length?