josStorer / RWKV-Runner

A RWKV management and startup tool, full automation, only 8MB. And provides an interface compatible with the OpenAI API. RWKV is a large language model that is fully open source and available for commercial use.
https://www.rwkv.com
MIT License
5.05k stars 481 forks source link

maxtoken设置的值较小时 回答的内容会被截断 #370

Open LeopoldFize opened 1 month ago

LeopoldFize commented 1 month ago

当我将最大响应token设置的较小时(比如200)模型输出的内容会被截断 比如我问 介绍一下XXX 回复应该是500个字 但我将最大token的值设置为最小时 回复还是500个字 不过被截断了 只返回给我了30个(大概)字

josStorer commented 1 month ago

max_tokens的作用就是限制生成的回答的长度,到达max_tokens时直接停止响应,表现为截断

LeopoldFize commented 1 month ago

max_tokens的作用就是限制生成的回答的长度,到达max_tokens时直接停止响应,表现为截断

那么如何限制回答的长度呢

josStorer commented 1 month ago

max_tokens的作用就是限制生成的回答的长度

LeopoldFize commented 1 month ago

max_tokens的作用就是限制生成的回答的长度

你好,我的意思是 如何让他将回复的内容控制在50个字内 而不是达到50字时将回答内容截断.

josStorer commented 1 month ago

地球上目前没有任何模型能保证准确做到这件事,严格来说 AI 并不会数数

LeopoldFize commented 1 month ago

好的 明白了 ,谢谢你的回复

josStorer commented 1 month ago

一个可能的方法是,通过prompt要求它生成的回答尽可能简短,限制在XX字数内,然后生成完毕后,通过程序检测字数是否符合要求,如果不符合就重试,AI本身会将文本处理为token,只能二次开发处理字数

LeopoldFize commented 1 month ago

好的 我尝试一下 谢谢你