[LogProbs]Enable prompt logprobs output and modify data transmission method for the online interface. (#5089)

* add prompt logprobs

* Merge prompt_logprobs_tensors and prompt_logprobs

* fix param check

* trigger ci

* fix unitest

* fix logprobs bug
This commit is contained in:
qwes5s5
2025-12-02 13:49:51 +08:00
committed by GitHub
parent af39819fcd
commit 117980dd4e
27 changed files with 4947 additions and 233 deletions

View File

@@ -229,8 +229,15 @@ 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:
num_max_logprobs = args.get("max_logprobs", None)
if num_max_logprobs is not None and num_max_logprobs < -1:
raise ValueError(" The possible values for max_logprobs can't be less than -1 ")
if self.ori_vocab_size is not None and num_max_logprobs is not None:
if num_max_logprobs > self.ori_vocab_size:
raise ValueError(
f" The possible values for max_logprobs can't be greater than the vocabulary size {self.ori_vocab_size}"
)
self._post_init()