mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[plugin] Custom model_runner/model support (#3186)
* support custom model&&model_runner * fix merge * add test && update doc * fix codestyle * fix unittest * load model in rl
This commit is contained in:
@@ -48,6 +48,7 @@ class Attention(nn.Layer):
|
||||
linear_shift: paddle.Tensor = None,
|
||||
linear_smooth: paddle.Tensor = None,
|
||||
use_neox_rotary_style: bool = False,
|
||||
use_qk_norm: bool = False,
|
||||
) -> None:
|
||||
"""
|
||||
Initializes `LMLayer` with the given parameters.
|
||||
|
@@ -64,9 +64,9 @@ class ModelRegistry:
|
||||
|
||||
@classmethod
|
||||
def get_supported_archs(cls):
|
||||
assert len(cls._arch_to_model_cls) == len(
|
||||
cls._arch_to_model_cls
|
||||
), "model class / pretrained model registry num is not same"
|
||||
assert len(cls._arch_to_model_cls) >= len(
|
||||
cls._arch_to_pretrained_model_cls
|
||||
), "model class num is more than pretrained model registry num"
|
||||
return [key for key in cls._arch_to_model_cls.keys()]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user