Skip to content

Commit f1e766e

Browse files
committed
Use SUT_FACTORY instead of SUTS everywhere.
1 parent dc0ccc4 commit f1e766e

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/modelplane/runways/responder.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
import tempfile
55

66
import mlflow
7-
87
from modelgauge.pipeline_runner import build_runner
9-
from modelgauge.sut_registry import SUTS
8+
from modelgauge.sut_factory import SUT_FACTORY
109

10+
from modelplane.runways.data import (
11+
Artifact,
12+
BaseInput,
13+
RunArtifacts,
14+
build_and_log_input,
15+
)
1116
from modelplane.runways.utils import (
1217
CACHE_DIR,
1318
MODELGAUGE_RUN_TAG_NAME,
@@ -17,12 +22,6 @@
1722
is_debug_mode,
1823
setup_sut_credentials,
1924
)
20-
from modelplane.runways.data import (
21-
Artifact,
22-
BaseInput,
23-
RunArtifacts,
24-
build_and_log_input,
25-
)
2625

2726

2827
def respond(
@@ -37,7 +36,7 @@ def respond(
3736
prompt_text_col=None,
3837
) -> RunArtifacts:
3938
secrets = setup_sut_credentials(sut_id)
40-
sut = SUTS.make_instance(uid=sut_id, secrets=secrets)
39+
sut = SUT_FACTORY.make_instance(uid=sut_id, secrets=secrets)
4140
params = {"num_workers": num_workers}
4241
tags = {"sut_id": sut_id, RUN_TYPE_TAG_NAME: RUN_TYPE_RESPONDER}
4342

src/modelplane/runways/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
from typing import List
33

44
import mlflow
5-
65
from modelgauge.annotator_registry import ANNOTATORS
76
from modelgauge.config import (
87
SECRETS_PATH,
98
load_secrets_from_config,
109
raise_if_missing_from_config,
1110
)
1211
from modelgauge.secret_values import RawSecrets
13-
from modelgauge.sut_registry import SUTS
12+
from modelgauge.sut_factory import SUT_FACTORY
1413

1514
# Path to the secrets toml file
1615
SECRETS_PATH_ENV = "MODEL_SECRETS_PATH"
@@ -35,7 +34,7 @@ def is_debug_mode() -> bool:
3534
def setup_sut_credentials(uid: str) -> RawSecrets:
3635
missing_secrets = []
3736
secrets = safe_load_secrets_from_config()
38-
missing_secrets.extend(SUTS.get_missing_dependencies(uid, secrets=secrets))
37+
missing_secrets.extend(SUT_FACTORY.get_missing_dependencies(uid, secrets=secrets))
3938
raise_if_missing_from_config(missing_secrets)
4039
return secrets
4140

0 commit comments

Comments
 (0)