[NPU] [Bugfix] [Diffusion] Fixed gray images at the generation output (#23266)
Co-authored-by: ronnie_zheng <zl19940307@163.com>
This commit is contained in:
co-authored by
ronnie_zheng
parent
6175946db7
commit
bd523dd60d
@@ -28,6 +28,7 @@ def apply_rotary_embedding_native(
|
||||
and x.dim() == 3
|
||||
and x.shape[1] < NPU_ROTARY_MUL_MAX_NUM_HEADS
|
||||
and x.shape[2] < NPU_ROTARY_MUL_MAX_HEAD_SIZE
|
||||
and not interleaved
|
||||
):
|
||||
if cos.size(-1) * 2 == x.size(-1):
|
||||
cos = torch.cat([cos, cos], dim=-1)
|
||||
|
||||
Reference in New Issue
Block a user