ChatGLM-6B icon indicating copy to clipboard operation
ChatGLM-6B copied to clipboard

无法按照指定字数生成文章?

Open xieyongshuai opened this issue 2 years ago • 3 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

image 无法生成指定字数文章

Expected Behavior

No response

Steps To Reproduce

无法生成指定字数文章

Environment

- OS:Ubuntu
- Python: 3.7
- Transformers:4.27.1
- PyTorch:1.10
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

xieyongshuai avatar May 04 '23 07:05 xieyongshuai

+1

surviveMiao avatar May 07 '23 02:05 surviveMiao

因为使用的分词器不是按字切分的,用的是sentencePiece,这个感觉就没办法准确吧,模型也不知道每个token的长度本身是多少个字

SCAUapc avatar May 10 '23 09:05 SCAUapc

生成的时候,有参数min_new_tokens,max_new_tokens设置一年就按照“token”个数生成了。

tomcat123a avatar May 29 '23 10:05 tomcat123a