[XPU]add enable_logprob (#5279)

* [XPU]Update document

* [XPU]Update documentation

* [XPU]add enable_logprob

* Fix code style issues

* “doc”

* “docs”

* “doc”

* Fix code style via pre-commit

---------

Co-authored-by: root <root@gajl-bbc-onlinec-com-1498354.gajl.baidu.com>
This commit is contained in:
qw86972190
2025-12-02 15:32:28 +08:00
committed by GitHub
parent c563eca791
commit 6048ea37bd
7 changed files with 315 additions and 14 deletions

View File

@@ -69,8 +69,8 @@ def get_worker(fd_config: FDConfig, local_rank: int, rank: int) -> WorkerBase:
"""
get worker of different device
"""
if fd_config.model_config.enable_logprob and not current_platform.is_cuda():
raise NotImplementedError("Only CUDA platform supports logprob.")
if fd_config.model_config.enable_logprob and not current_platform.is_cuda() and not current_platform.is_xpu():
raise NotImplementedError("Only CUDA and XPU platforms support logprob.")
if current_platform.is_dcu():
from fastdeploy.worker.dcu_worker import DcuWorker