[Logprobs]Support prompt_logprobs and max_logprobs (#4897)

* add prompt logprobs

* trigger ci

* fix unitest

* Update fastdeploy/config.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update fastdeploy/entrypoints/llm.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update fastdeploy/engine/sampling_params.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/engine/test_sampling_params.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/engine/test_sampling_params.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix max_logprobs

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
qwes5s5
2025-11-12 19:29:48 +08:00
committed by GitHub
parent da7863ae85
commit a2d06118e1
9 changed files with 623 additions and 9 deletions

View File

@@ -227,8 +227,8 @@ class ModelConfig:
self.think_end_id = args.get("think_end_id", -1)
self.im_patch_id = args.get("image_patch_id", -1)
self.line_break_id = args.get("line_break_id", -1)
if self.max_logprobs == -1 and hasattr(self, "vocab_size"):
self.max_logprobs = self.vocab_size
if self.max_logprobs < -1:
raise ValueError(" The possible values for max_logprobs can't be less than -1 ")
self._post_init()