Repair MiniCPM-o and InternVLA scoped E2E paths
This commit is contained in:
1 parent
2d8b1d4583
commit
c0deaa76ba
36 files changed
+3498
-83
No files matched your search
@@ -301,12 +301,20 @@ class MiniCPMO45OmniForConditionalGeneration(nn.Module, SupportsMultiModal, Supp
|
||||
if self.model_stage == "tts":
|
||||
return self.talker.preprocess(input_ids=input_ids, input_embeds=input_embeds, **kwargs)
|
||||
if self.model_stage != "llm":
|
||||
embeds = input_embeds if input_embeds is not None else self.get_input_embeddings(input_ids)
|
||||
embeds = (
|
||||
input_embeds
|
||||
if kwargs.get("_omni_input_embeds_precomputed") and input_embeds is not None
|
||||
else self.get_input_embeddings(input_ids)
|
||||
)
|
||||
return input_ids, embeds, {}
|
||||
|
||||
duplex = kwargs.get("duplex")
|
||||
if not isinstance(duplex, dict) or duplex.get("data_plane") is not True:
|
||||
embeds = input_embeds if input_embeds is not None else self.get_input_embeddings(input_ids)
|
||||
embeds = (
|
||||
input_embeds
|
||||
if kwargs.get("_omni_input_embeds_precomputed") and input_embeds is not None
|
||||
else self.get_input_embeddings(input_ids)
|
||||
)
|
||||
return input_ids, embeds, {}
|
||||
|
||||
prompt_len_meta = kwargs.get("duplex_prompt_len")
|
||||
|
||||
@@ -174,7 +174,13 @@ class StepAudio2Token2WavCore(nn.Module):
|
||||
)
|
||||
|
||||
with open(f"{self.model_path}/flow.yaml") as f:
|
||||
configs = load_hyperpyyaml(f)
|
||||
flow_yaml = f.read()
|
||||
# MiniCPM-o's flow.yaml names the standalone ``cosyvoice2`` package,
|
||||
# while the shared in-tree vocoder uses its implementation shipped in
|
||||
# ``stepaudio2-minicpmo``. Resolve those YAML tags locally instead of
|
||||
# relying on the external Token2wav constructor's sys.modules aliases.
|
||||
flow_yaml = flow_yaml.replace("!new:cosyvoice2.", "!new:stepaudio2.cosyvoice2.")
|
||||
configs = load_hyperpyyaml(io.StringIO(flow_yaml))
|
||||
self._flow = configs["flow"]
|
||||
if self.float16:
|
||||
self._flow.half()
|
||||
|
||||
Reference in new issue
Block a user