【Feature】add fd plugins && rm model_classes (#3123)

* add fd plugins && rm model_classed

* fix reviews

* add docs

* fix

* fix unitest ci
This commit is contained in:
gaoziyuan
2025-08-04 10:53:20 +08:00
committed by GitHub
parent 1582814905
commit 4021d66ea5
25 changed files with 524 additions and 59 deletions
+26 -3
View File
@@ -22,11 +22,10 @@ import sys
os.environ["GLOG_minloglevel"] = "2"
# suppress log from aistudio
os.environ["AISTUDIO_LOG"] = "critical"
import typing
from fastdeploy.engine.sampling_params import SamplingParams
from fastdeploy.entrypoints.llm import LLM
from fastdeploy.utils import version
__all__ = ["LLM", "SamplingParams", "version"]
try:
import use_triton_in_paddle
@@ -86,3 +85,27 @@ def _patch_fastsafetensors():
_patch_fastsafetensors()
MODULE_ATTRS = {"ModelRegistry": ".model_executor.models.model_base:ModelRegistry", "version": ".utils:version"}
if typing.TYPE_CHECKING:
from fastdeploy.model_executor.models.model_base import ModelRegistry
else:
def __getattr__(name: str) -> typing.Any:
from importlib import import_module
if name in MODULE_ATTRS:
try:
module_name, attr_name = MODULE_ATTRS[name].split(":")
module = import_module(module_name, __package__)
return getattr(module, attr_name)
except ModuleNotFoundError:
print(f"Module {MODULE_ATTRS[name]} not found.")
else:
print(f"module {__package__} has no attribute {name}")
__all__ = ["LLM", "SamplingParams", "ModelRegistry", "version"]