mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
@@ -49,7 +49,6 @@ from fastdeploy.platforms import current_platform
|
|||||||
|
|
||||||
if current_platform.is_cuda():
|
if current_platform.is_cuda():
|
||||||
from fastdeploy.model_executor.ops.gpu import (
|
from fastdeploy.model_executor.ops.gpu import (
|
||||||
extract_text_token_output,
|
|
||||||
text_image_gather_scatter,
|
text_image_gather_scatter,
|
||||||
text_image_index_out,
|
text_image_index_out,
|
||||||
)
|
)
|
||||||
@@ -544,17 +543,6 @@ class Ernie4_5_VLModel(nn.Layer):
|
|||||||
)
|
)
|
||||||
|
|
||||||
hidden_states = hidden_states + residual
|
hidden_states = hidden_states + residual
|
||||||
|
|
||||||
max_seq_len, max_seq_len_index = paddle.topk(forward_meta.seq_lens_this_time, k=1)
|
|
||||||
hidden_states = extract_text_token_output(
|
|
||||||
max_seq_len,
|
|
||||||
max_seq_len_index.cast("int32"),
|
|
||||||
vl_moe_meta.image_token_num.cast("int32"),
|
|
||||||
forward_meta.seq_lens_this_time,
|
|
||||||
forward_meta.cu_seqlens_q,
|
|
||||||
hidden_states.cast("float32"),
|
|
||||||
).cast(self._dtype)
|
|
||||||
|
|
||||||
out = self.norm(hidden_states)
|
out = self.norm(hidden_states)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
@@ -1298,7 +1298,6 @@ class GPUModelRunner(ModelRunnerBase):
|
|||||||
self.share_inputs["image_features"],
|
self.share_inputs["image_features"],
|
||||||
self.forward_meta,
|
self.forward_meta,
|
||||||
)
|
)
|
||||||
hidden_states = model_output
|
|
||||||
else:
|
else:
|
||||||
model_output = self.model(
|
model_output = self.model(
|
||||||
ids_remove_padding=self.share_inputs["ids_remove_padding"],
|
ids_remove_padding=self.share_inputs["ids_remove_padding"],
|
||||||
@@ -1608,7 +1607,6 @@ class GPUModelRunner(ModelRunnerBase):
|
|||||||
self.share_inputs["image_features"],
|
self.share_inputs["image_features"],
|
||||||
self.forward_meta,
|
self.forward_meta,
|
||||||
)
|
)
|
||||||
hidden_states = model_output
|
|
||||||
else:
|
else:
|
||||||
model_output = self.model(
|
model_output = self.model(
|
||||||
ids_remove_padding=self.share_inputs["ids_remove_padding"],
|
ids_remove_padding=self.share_inputs["ids_remove_padding"],
|
||||||
|
Reference in New Issue
Block a user