1
1、inputs = tokenizer([prompt], return_tensors="pt", padding='max_length', max_length=64)对token进行padding,推理结果不对 2、想要定长推理,所以每增加一个token,就删除一个padding ![Uploading image.png…]()
Environment- OS:Ubuntu 20.04
- Python:3.7
- Transformers:4.26.1
- PyTorch:1.11
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :