Add CFG to server - #2217
Conversation
|
Hmm, are you running in dark mode? I am not that good at the web design, so it may look a bit weird. It also has a lot of debug strings all over the place but I will clean it up when it's more finished. |
|
@SlyEcho you going to get this merged? whats left ? |
|
I have to start again because the server changed so much in the meantime |
I wonder if we can just get the feature in with the flag to allow for the inputs, it seems like you did most of the heavy lifting, maybe the ui work can come in a secondary pr |
|
Yeah, I should have not put the UI stuff in here, it was too much changes at the same time. I hope to have more time over the holidays when I don't have lectures to give any more. |
|
Having CFG for the server api would be so nice, will this PR get eventually revived? |
|
@SlyEcho, we wait cfg oportuniy)) |
|
I would have to redo the entire PR, because so much has changed in the mean time. Originally, I got stuck when trying to merge some of the frontend changes. |


From #2135
TODOs
Adding new API parameters:
cfg_negative_promptcfg_scalecfg_n_keepcfg_n_keepis new to server that main.cpp doesn't have, it allows the negative prompt to be managed just like the main prompt.Since the server doesn't have a chat memory itself the client has to now format two prompt strings to use this feature.
repeat_last_ntokens now are not limited to the context size and can span however long you want, making sampling memory longer than context.Normal:
{ "prompt": "A chat between a curious user and a pirate.\n\n### Instruction:\nWhat's your name?\n\n### Response:\n", "n_predict": 32, "stop": ["###"] }Random responses
With negative prompt:
{ "prompt": "A chat between a curious user and a pirate.\n\n### Instruction:\nWhat's your name?\n\n### Response:\n", "cfg_negative_prompt": "A chat between a curious user and an artificial intelligence assistant.\n\n### Instruction:\nWhat's your name?\n\n### Response:\n", "cfg_scale": 4.0, "n_predict": 32, "stop": ["###"] }Responses, but the first one was with the "smooth factor" that is now gone.