[Feature 2.0.2] support top_k_top_p sampling (#2789)

* support top_k_top_p sampling

* fix

* add api param

* add api para

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* change func name
This commit is contained in:
Sunny-bot1
2025-07-10 12:01:51 +08:00
committed by GitHub
parent 1fe37cb7e8
commit 1107e08cd9
18 changed files with 524 additions and 134 deletions

View File

@@ -1021,8 +1021,8 @@ class LLMEngine(object):
py_script = os.path.join(current_dir_path, worker_path)
ori_vocab_size = (
len(self.data_processor.tokenizer.sp_model)
if hasattr(self.data_processor.tokenizer, 'sp_model')
len(self.data_processor.tokenizer.sp_model)
if hasattr(self.data_processor.tokenizer, 'sp_model')
else len(self.data_processor.tokenizer.vocab)
)