-
Notifications
You must be signed in to change notification settings - Fork 590
[plugin] Custom model_runner/model support #3186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[plugin] Custom model_runner/model support #3186
Conversation
Thanks for your contribution! |
LGTM |
fastdeploy/worker/gpu_worker.py
Outdated
except: | ||
from fastdeploy.worker.gpu_model_runner import GPUModelRunner as ModelRunner | ||
|
||
# ModelRunner = get_model_runner() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log删一下
|
||
runner_class = load_model_runner_plugins() | ||
|
||
# 创建 runner 实例 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释写英文的好一点
|
||
# 创建 runner 实例 | ||
if not callable(runner_class): | ||
print("The returned runner constructor is not callable.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成assert判断吧,CI中可以加上这个,监控起来这个接口
@@ -1,6 +1,21 @@ | |||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025
@@ -0,0 +1,27 @@ | |||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025
@@ -3,13 +3,11 @@ | |||
setup( | |||
name="fastdeploy-plugins", | |||
version="0.1", | |||
packages=["fd_add_dummy_model"], | |||
packages=["fd_add_dummy_model", "fd_add_dummy_model_runner"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个文件顺便都加一下copyrights吧
@@ -0,0 +1,12 @@ | |||
from fastdeploy.plugins import load_model_runner_plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同
d6c81b7
to
2ceac9e
Compare
默认走原生model&model_runner;
安装plugin且指定export FD_PLUGINS="model"情况下注册自定义的model(model为自定义的model plugin):
安装plugin且指定export FD_PLUGINS="model,model_runner"的情况下注册自定义的model并优先加载自定义的model_runner(model_runner为自定义的model_runner plugin)
安装plugin且不指定FD_PLUGINS,默认加载所有plugin