Skip to content

Commit 978d203

Browse files
committed
add infer_model_cls to evaluate.py utils
1 parent 6b04d8d commit 978d203

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/tabflow/utils.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import yaml
33
import boto3
44

5+
from tabrepo.benchmark.models.model_register import infer_model_cls
6+
7+
58
def yaml_to_methods(methods_file: str) -> list:
69
with open(methods_file, 'r') as file:
710
methods_config = yaml.safe_load(file)
@@ -15,7 +18,8 @@ def parse_method(method_config: dict, context=None):
1518
# Convert string class names to actual class references
1619
# This assumes the classes are already defined or imported in evaluate.py
1720
if 'model_cls' in method_config:
18-
method_config['model_cls'] = eval(method_config['model_cls'], context)
21+
method_config["model_cls"] = infer_model_cls(method_config["model_cls"])
22+
# method_config['model_cls'] = eval(method_config['model_cls'], context)
1923
if 'method_cls' in method_config:
2024
method_config['method_cls'] = eval(method_config['method_cls'], context)
2125

0 commit comments

Comments
 (0)