Remove unused code and comments in GPUDiffusionModelRunner for improved clarity
- Deleted the `has_kv_transfer_group` import as it was not utilized. - Cleaned up commented-out code related to model methods, focusing on the forward method. - Added a TODO comment to implement the diffuse method for additional model support.
This commit is contained in:
1 parent
ea16546ae9
commit
634915652d
1 file changed
+1
-12
@@ -1,5 +1,3 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional, Union, List
|
||||
@@ -13,7 +11,6 @@ from vllm.v1.worker.gpu_model_runner import (
|
||||
EMPTY_MODEL_RUNNER_OUTPUT,
|
||||
IntermediateTensors,
|
||||
get_pp_group,
|
||||
has_kv_transfer_group,
|
||||
set_forward_context,
|
||||
)
|
||||
from vllm.v1.worker.utils import sanity_check_mm_encoder_outputs
|
||||
@@ -187,21 +184,13 @@ class GPUDiffusionModelRunner(OmniGPUModelRunner):
|
||||
# For Qwen 2.5 Omni's current implementation, we only support the forward method
|
||||
if hasattr(self.model, "forward"):
|
||||
return self.model.forward(**kwargs)
|
||||
|
||||
# if hasattr(self.model, "sample"):
|
||||
# return self.model.sample(**kwargs)
|
||||
# if hasattr(self.model, "forward"):
|
||||
# return self.model.forward(**kwargs)
|
||||
# if hasattr(self.model, "diffuse"):
|
||||
# return self.model.diffuse(**kwargs)
|
||||
#TODO: add the diffuse method for other models
|
||||
|
||||
raise RuntimeError(
|
||||
"The loaded model does not expose diffusion interfaces 'sample', "
|
||||
"'forward', or 'diffuse'. Please implement one of them or adapt the runner.")
|
||||
|
||||
|
||||
|
||||
|
||||
@torch.inference_mode()
|
||||
def _dummy_run(
|
||||
self,
|
||||
|
||||
Reference in new issue
Block a user