XiangLi1999 / Diffusion-LM

Diffusion-LM
Apache License 2.0
1.02k stars 133 forks source link

How to control the length #29

Open gwang-kim opened 1 year ago

gwang-kim commented 1 year ago

In the paper, the length of the generated sentence can be controlled without a classifier. How can we do this? Could you give us a detailed explanation or implementation for this?

Best,

Gwanghyun

XiangLi1999 commented 1 year ago

Hi, I think you can control length by running ''' python python scripts/infill.py --model_path {path-to-diffusion-lm} --evaltask 'length' --tgt_len [your target length] --use_ddim True --eta 1. --verbose pipe '''