[PluggableLayer][MM] Add PluggableLayer for CustomQwen2Decoder (#37293)
Signed-off-by: Wangbei25 <wangbei41@huawie.com> Signed-off-by: Wangbei25 <wangbei41@huawei.com> Co-authored-by: Wangbei25 <wangbei41@huawie.com>
This commit is contained in:
@@ -14,14 +14,20 @@ import torch
|
||||
import torch.nn as nn
|
||||
import transformers
|
||||
|
||||
from vllm.model_executor.custom_op import PluggableLayer
|
||||
|
||||
class CustomQwen2Decoder(nn.Module):
|
||||
|
||||
# --8<-- [start:qwen2_decoder]
|
||||
@PluggableLayer.register("qwen2_decoder")
|
||||
class CustomQwen2Decoder(PluggableLayer):
|
||||
"""
|
||||
Qwen2 visual encoder
|
||||
non-causal attention + causal attention
|
||||
token_type_ids :0=non-causal, 1=causal
|
||||
"""
|
||||
|
||||
# --8<-- [end:qwen2_decoder]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
decoder_layer: int = 24,
|
||||
|
||||
Reference in New Issue
Block a user