/props endpoint: provide context size through default_generation_settings (#1237)

This commit is contained in:
kallewoof 2024-11-26 17:15:27 +09:00 committed by GitHub
parent 6bd686c8a8
commit fd320f6682
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2013,7 +2013,13 @@ Enter Prompt:<br>
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'