We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4be1bb9 commit 527ca13Copy full SHA for 527ca13
dingo/model/model.py
@@ -1,4 +1,5 @@
1
import importlib
2
+import inspect
3
import os
4
from functools import wraps
5
from typing import Callable, Dict, List, Optional
@@ -198,14 +199,13 @@ def llm_register(cls, llm_id: str) -> Callable:
198
199
Args:
200
llm_id (str): Name of llm model class.
201
"""
- def decorator(root_method):
202
- cls.llm_name_map[llm_id] = root_method
203
-
204
- @wraps(root_method)
205
- def wrapped_function(*args, **kwargs):
206
- return root_method(*args, **kwargs)
+ def decorator(root_class):
+ cls.llm_name_map[llm_id] = root_class
207
208
- return wrapped_function
+ if inspect.isclass(root_class):
+ return root_class
+ else:
+ raise ValueError("root_class must be a class")
209
210
return decorator
211
0 commit comments