LostRuins / koboldcpp

Run GGUF models easily with a KoboldAI UI. One File. Zero Install.
https://github.com/lostruins/koboldcpp
GNU Affero General Public License v3.0
4.99k stars 349 forks source link

Can't ban multiple tokens in .kcpps file? #762

Closed pbz134 closed 6 months ago

pbz134 commented 6 months ago

I want to ban tokens, such as "###instruction" or "" (as they often are being generated by the model and it annoys me) but specifying them always results in a json error when executing the file.

Here is my .kcpps file with what I got now: {"model": null, "model_param": "model.gguf", "port": 5001, "port_param": 5001, "host": "", "launch": true, "lora": null, "config": null, "threads": 15, "blasthreads": null, "highpriority": false, "contextsize": 2048, "blasbatchsize": 512, "ropeconfig": [0.0, 10000.0], "smartcontext": false, "noshift": false, "bantokens": "#", "forceversion": 0, "nommap": true, "usemlock": false, "noavx2": false, "debugmode": 0, "skiplauncher": false, "hordeconfig": null, "noblas": false, "useclblast": null, "usecublas": ["normal", "0", "mmq"], "usevulkan": null, "gpulayers": 200, "tensor_split": null, "onready": "", "benchmark": null, "multiuser": 1, "remotetunnel": false, "foreground": false, "quiet": false, "ssl": null, "nocertify": false}

LostRuins commented 6 months ago

I'd recommend removing them with logit bias instead. For example: image

pbz134 commented 6 months ago

Is this configurable in a .kcpps file? I'm using koboldcpp over the API.

LostRuins commented 6 months ago

It's not configurable in the kcpps file, it's a field sent over the API, called logit_bias.

See this: https://koboldai-koboldcpp-tiefighter.hf.space/api/#/api%2Fv1/post_api_v1_generate

pbz134 commented 6 months ago

Got it, thank you!