[Core] Retain structured configs through runtime startup (#6849)
Signed-off-by: maithilijoshi20 <97733343+maithilijoshi20@users.noreply.github.com>
This commit is contained in:
1 parent
becfefd440
commit
f1a6e7ce2a
49 files changed
+1856
-331
No files matched your search
@@ -248,10 +248,27 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
|
||||
return obj.get(key, default)
|
||||
return getattr(obj, key, default)
|
||||
|
||||
@classmethod
|
||||
def _stage_model_metadata(cls, stage: Any) -> tuple[str | None, str | None]:
|
||||
"""Return ``(model_arch, model_stage)`` for typed or legacy stages."""
|
||||
model_config = cls._stage_get(stage, "model_config")
|
||||
model_arch = cls._stage_get(model_config, "model_arch")
|
||||
model_stage = cls._stage_get(stage, "model_stage")
|
||||
|
||||
topology = cls._stage_get(stage, "stage_pipeline_config")
|
||||
if model_stage is None:
|
||||
model_stage = cls._stage_get(topology, "model_stage")
|
||||
|
||||
engine_args = cls._stage_get(stage, "engine_args")
|
||||
if model_arch is None:
|
||||
model_arch = cls._stage_get(engine_args, "model_arch")
|
||||
if model_stage is None:
|
||||
model_stage = cls._stage_get(engine_args, "model_stage")
|
||||
return model_arch, model_stage
|
||||
|
||||
def _has_minicpmo45_stage(self) -> bool:
|
||||
for stage in getattr(self.engine_client, "stage_configs", []) or []:
|
||||
engine_args = self._stage_get(stage, "engine_args")
|
||||
model_arch = self._stage_get(engine_args, "model_arch")
|
||||
model_arch, _ = self._stage_model_metadata(stage)
|
||||
if model_arch == "MiniCPMO45OmniForConditionalGeneration":
|
||||
return True
|
||||
return False
|
||||
@@ -324,11 +341,10 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
|
||||
if not hasattr(sp, "output_kind"):
|
||||
continue
|
||||
|
||||
engine_args = self._stage_get(stage, "engine_args")
|
||||
if self._stage_get(engine_args, "model_arch") != "MiniCPMO45OmniForConditionalGeneration":
|
||||
model_arch, model_stage = self._stage_model_metadata(stage)
|
||||
if model_arch != "MiniCPMO45OmniForConditionalGeneration":
|
||||
continue
|
||||
|
||||
model_stage = self._stage_get(engine_args, "model_stage")
|
||||
if model_stage == "llm":
|
||||
sp.output_kind = RequestOutputKind.FINAL_ONLY
|
||||
elif model_stage == "tts":
|
||||
|
||||
Reference in new issue
Block a user