From fd320f66828361f06dae65cc1610863b6be5de80 Mon Sep 17 00:00:00 2001 From: kallewoof Date: Tue, 26 Nov 2024 17:15:27 +0900 Subject: [PATCH] /props endpoint: provide context size through default_generation_settings (#1237) --- koboldcpp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index b6ba56938..91fecb80d 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -2013,7 +2013,13 @@ Enter Prompt:
elif self.path=="/props": ctbytes = handle.get_chat_template() chat_template = ctypes.string_at(ctbytes).decode("UTF-8","ignore") - response_body = (json.dumps({"chat_template":chat_template,"total_slots":1}).encode()) + response_body = (json.dumps({ + "chat_template": chat_template, + "total_slots": 1, + "default_generation_settings": { + "n_ctx": maxctx, + }, + }).encode()) elif self.path=="/api" or self.path=="/docs" or self.path.startswith(('/api/?json=','/api?json=','/docs/?json=','/docs?json=')): content_type = 'text/html'