[v1] model loader (#9613)

This commit is contained in:
Yaowei Zheng
2025-12-14 11:50:52 +08:00
committed by GitHub
parent fdd24276ed
commit aeda079014
27 changed files with 449 additions and 305 deletions

View File

@@ -38,7 +38,7 @@ class BasePlugin:
self.name = name
@property
def register(self) -> Callable:
def register(self):
"""Decorator to register a function as a plugin.
Example usage:
@@ -60,7 +60,7 @@ class BasePlugin:
return decorator
def __call__(self, *args, **kwargs) -> Callable:
def __call__(self, *args, **kwargs):
"""Call the registered function with the given arguments.
Example usage:
@@ -75,6 +75,9 @@ class BasePlugin:
if __name__ == "__main__":
"""
python -m llamafactory.v1.utils.plugin
"""
class PrintPlugin(BasePlugin):
pass