Fix duplicate get_supported_tasks definition in async_omni.py (#1825)
Signed-off-by: linyueqian <linyueqian@outlook.com>
This commit is contained in:
1 parent
da4a077155
commit
e1efcb7560
2 files changed
+16
-12
No files matched your search
@@ -141,10 +141,12 @@ class AsyncOmni(OmniBase):
|
||||
)
|
||||
|
||||
async def get_supported_tasks(self) -> set[str]:
|
||||
"""Return supported tasks based on the configured stage output modalities."""
|
||||
"""Return supported tasks based on stage output modalities and capabilities."""
|
||||
tasks: set[str] = set()
|
||||
if "text" in self.output_modalities:
|
||||
if "text" in self.output_modalities or any(stage.is_comprehension for stage in self.stage_list):
|
||||
tasks.add("generate")
|
||||
if "audio" in self.output_modalities:
|
||||
tasks.add("speech")
|
||||
return tasks
|
||||
|
||||
def _create_default_diffusion_stage_cfg(self, kwargs: dict[str, Any]) -> dict[str, Any]:
|
||||
@@ -838,16 +840,6 @@ class AsyncOmni(OmniBase):
|
||||
stage.submit(abort_task)
|
||||
return None
|
||||
|
||||
async def get_supported_tasks(self) -> set[str]:
|
||||
tasks: set[str] = set()
|
||||
has_comprehension = any(stage.is_comprehension for stage in self.stage_list)
|
||||
if has_comprehension:
|
||||
tasks.add("generate")
|
||||
for stage in self.stage_list:
|
||||
if getattr(stage, "final_output_type", None) == "audio":
|
||||
tasks.add("speech")
|
||||
return tasks if tasks else {"generate"}
|
||||
|
||||
async def get_vllm_config(self) -> VllmConfig:
|
||||
for stage in self.stage_list:
|
||||
if stage.is_comprehension:
|
||||
|
||||
Reference in new issue
Block a user