[Bugfix] Fix task field initialization when PYTHONOPTIMIZE is enabled (#23718)

Signed-off-by: cndoit18 <cndoit18@outlook.com>
This commit is contained in:
cndoit18 2025-08-27 20:42:20 +08:00 committed by GitHub
parent 9d30de4469
commit 8c13820f0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -199,8 +199,9 @@ class PoolingModelRunner(
pooling_params = seq_group_metadata.pooling_params
assert pooling_params is not None
assert (task := pooling_params.task) is not None, (
"You did not set `task` in the API")
task = pooling_params.task
assert task is not None, "You did not set `task` in the API"
model = cast(VllmModelForPooling, self.model)
to_update = model.pooler.get_pooling_updates(task)