We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
paddle.maximum
1 parent 1eb8ea7 commit fefbd65Copy full SHA for fefbd65
fastdeploy/model_executor/models/ernie4_5_vl/ernie4_5_vl_moe.py
@@ -393,8 +393,7 @@ def forward(
393
token_type_ids = image_mask.cast("int32")
394
token_num = hidden_states.shape[0]
395
image_token_num = paddle.count_nonzero(token_type_ids).cast("int32")
396
- text_token_num = ((token_num - image_token_num) if
397
- (token_num - image_token_num) > 0 else 1)
+ text_token_num = paddle.maximum(token_num - image_token_num, paddle.ones([], dtype="int32"))
398
if image_mask.any():
399
hidden_states[image_mask] = image_features.cast(self._dtype)
400
text_input = paddle.full(
0 commit comments