mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user