Commit Graph

9 Commits (3108ee24b546a53dcdc4e8c64486e664254534cb)

Author SHA1 Message Date
swaylq 3108ee24b5 fix: don't char-slice the prompt by max_new_tokens / max_tokens
web_demo.py rendered the full user message in the chat bubble but stored
prompt[-max_new_tokens:] in the message history, so the model received the
user's input front-truncated by *character* count using the generation-length
slider — the UI and the model saw different text, and the beginning of long
questions was silently dropped.

serve_openai_api.py applied the same [-max_tokens:] slice to the rendered
chat template, which corrupts the <|im_start|> structure (e.g. drops the
system block / cuts mid special-token) whenever a client sends a small
max_tokens. max_tokens is the *output* budget and has nothing to do with
trimming the input.

Store the full prompt instead. Input context is already bounded at the token
level by tokenizer(..., truncation=True) (model_max_length=131072).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 04:43:13 +08:00
jingyaogong 6b0b0c5e2f [update] fp16 inference 2026-03-27 16:29:46 +08:00
jingyaogong 101d7df2da [update] minimind-3 2026-03-25 23:57:45 +08:00
jingyaogong 08ce3da228 [feat] update args 2025-10-30 10:48:31 +08:00
jingyaogong bf123b585d [feat] add args 2025-10-30 10:05:12 +08:00
jingyaogong a62faf34bd 250426 2025-04-26 10:05:47 +08:00
jingyaogong 4a758564e4 fix top_p float bug 2025-04-09 16:52:20 +08:00
gongjy c9ca0f57dc update config 2025-02-10 00:14:11 +08:00
gongjy 58e3af0359 add minimind2 2025-02-09 23:49:47 +08:00