[Bugfix] Fix GLM-Image output dimensions and image edit pipeline (#2320)
Signed-off-by: JaredforReal <w13431838023@gmail.com> Signed-off-by: Jared Wen <w13431838023@gmail.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
c2859e9cd7
commit
7e28eda929
13 files changed
+1557
-231
No files matched your search
@@ -152,8 +152,10 @@ class OmniGPUModelRunner(GPUModelRunner):
|
||||
if supports_mrope(self.get_model()):
|
||||
# Model implements SupportsMRoPE interface
|
||||
# Pass all extracted metadata; models use what they need via **kwargs
|
||||
req_state.mrope_positions, req_state.mrope_position_delta = self.model.get_mrope_input_positions(
|
||||
req_state.prompt_token_ids,
|
||||
sp_extra_args = getattr(req_state.sampling_params, "extra_args", {}) if req_state.sampling_params else {}
|
||||
target_h = sp_extra_args.get("target_h") if isinstance(sp_extra_args, dict) else None
|
||||
target_w = sp_extra_args.get("target_w") if isinstance(sp_extra_args, dict) else None
|
||||
kwargs = dict(
|
||||
mm_features=req_state.mm_features,
|
||||
hf_config=self.model_config.hf_config,
|
||||
image_grid_thw=image_grid_thw,
|
||||
@@ -162,6 +164,14 @@ class OmniGPUModelRunner(GPUModelRunner):
|
||||
audio_feature_lengths=audio_feature_lengths,
|
||||
use_audio_in_video=use_audio_in_video,
|
||||
)
|
||||
if target_h is not None:
|
||||
kwargs["target_h"] = target_h
|
||||
if target_w is not None:
|
||||
kwargs["target_w"] = target_w
|
||||
req_state.mrope_positions, req_state.mrope_position_delta = self.model.get_mrope_input_positions(
|
||||
req_state.prompt_token_ids,
|
||||
**kwargs,
|
||||
)
|
||||
else:
|
||||
req_state.mrope_positions, req_state.mrope_position_delta = MRotaryEmbedding.get_input_positions_tensor(
|
||||
req_state.prompt_token_ids,
|
||||
|
||||
Reference in new issue
Block a user