From 445e879449cd54763e6aeee1a9ecd73e545c01cf Mon Sep 17 00:00:00 2001 From: aarushisingh04 Date: Thu, 8 Jan 2026 20:22:16 +0530 Subject: [PATCH 1/3] allow top_k=0 in web api to disable filtering --- scripts/chat_web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/chat_web.py b/scripts/chat_web.py index 4b67b62..eae5265 100644 --- a/scripts/chat_web.py +++ b/scripts/chat_web.py @@ -26,7 +26,7 @@ Abuse Prevention: - Maximum 8000 characters per message - Maximum 32000 characters total conversation length - Temperature clamped to 0.0-2.0 - - Top-k clamped to 1-200 + - Top-k clamped to 0-200 (0 disables top-k filtering, using full vocabulary) - Max tokens clamped to 1-4096 """ @@ -55,7 +55,7 @@ MAX_MESSAGE_LENGTH = 8000 MAX_TOTAL_CONVERSATION_LENGTH = 32000 MIN_TEMPERATURE = 0.0 MAX_TEMPERATURE = 2.0 -MIN_TOP_K = 1 +MIN_TOP_K = 0 MAX_TOP_K = 200 MIN_MAX_TOKENS = 1 MAX_MAX_TOKENS = 4096 From 04d816ea67a4345439a4469132212daff6f17a9d Mon Sep 17 00:00:00 2001 From: aarushisingh04 Date: Fri, 23 Jan 2026 18:29:14 +0530 Subject: [PATCH 2/3] adding a comment for clear reasoning --- scripts/chat_web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/chat_web.py b/scripts/chat_web.py index eae5265..a3945fe 100644 --- a/scripts/chat_web.py +++ b/scripts/chat_web.py @@ -26,7 +26,7 @@ Abuse Prevention: - Maximum 8000 characters per message - Maximum 32000 characters total conversation length - Temperature clamped to 0.0-2.0 - - Top-k clamped to 0-200 (0 disables top-k filtering, using full vocabulary) + - Top-k clamped to 1-200 - Max tokens clamped to 1-4096 """ @@ -55,7 +55,7 @@ MAX_MESSAGE_LENGTH = 8000 MAX_TOTAL_CONVERSATION_LENGTH = 32000 MIN_TEMPERATURE = 0.0 MAX_TEMPERATURE = 2.0 -MIN_TOP_K = 0 +MIN_TOP_K = 0 # 0 disables top-k filtering, using full vocabulary MAX_TOP_K = 200 MIN_MAX_TOKENS = 1 MAX_MAX_TOKENS = 4096 From 135f25efb9d37146e538d66c4b6774cb9f26ac42 Mon Sep 17 00:00:00 2001 From: aarushisingh04 Date: Fri, 23 Jan 2026 18:34:13 +0530 Subject: [PATCH 3/3] adding change to docstring --- scripts/chat_web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/chat_web.py b/scripts/chat_web.py index a3945fe..42c01ac 100644 --- a/scripts/chat_web.py +++ b/scripts/chat_web.py @@ -26,7 +26,7 @@ Abuse Prevention: - Maximum 8000 characters per message - Maximum 32000 characters total conversation length - Temperature clamped to 0.0-2.0 - - Top-k clamped to 1-200 + - Top-k clamped to 0-200 (0 disables top-k filtering, using full vocabulary) - Max tokens clamped to 1-4096 """