Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/modelplane/runways/responder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import tempfile

import mlflow

from modelgauge.pipeline_runner import build_runner
from modelgauge.sut_registry import SUTS
from modelgauge.sut_factory import SUT_FACTORY

from modelplane.runways.data import (
Artifact,
BaseInput,
RunArtifacts,
build_and_log_input,
)
from modelplane.runways.utils import (
CACHE_DIR,
MODELGAUGE_RUN_TAG_NAME,
Expand All @@ -17,12 +22,6 @@
is_debug_mode,
setup_sut_credentials,
)
from modelplane.runways.data import (
Artifact,
BaseInput,
RunArtifacts,
build_and_log_input,
)


def respond(
Expand All @@ -37,7 +36,7 @@ def respond(
prompt_text_col=None,
) -> RunArtifacts:
secrets = setup_sut_credentials(sut_id)
sut = SUTS.make_instance(uid=sut_id, secrets=secrets)
sut = SUT_FACTORY.make_instance(uid=sut_id, secrets=secrets)
params = {"num_workers": num_workers}
tags = {"sut_id": sut_id, RUN_TYPE_TAG_NAME: RUN_TYPE_RESPONDER}

Expand All @@ -58,7 +57,7 @@ def respond(
input_path=input_data.local_path(),
output_dir=pathlib.Path(tmp),
cache_dir=None if disable_cache else CACHE_DIR,
suts={sut_id: sut},
suts={sut.uid: sut},
prompt_uid_col=prompt_uid_col,
prompt_text_col=prompt_text_col,
)
Expand Down
5 changes: 2 additions & 3 deletions src/modelplane/runways/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
from typing import List

import mlflow

from modelgauge.annotator_registry import ANNOTATORS
from modelgauge.config import (
SECRETS_PATH,
load_secrets_from_config,
raise_if_missing_from_config,
)
from modelgauge.secret_values import RawSecrets
from modelgauge.sut_registry import SUTS
from modelgauge.sut_factory import SUT_FACTORY

# Path to the secrets toml file
SECRETS_PATH_ENV = "MODEL_SECRETS_PATH"
Expand All @@ -35,7 +34,7 @@ def is_debug_mode() -> bool:
def setup_sut_credentials(uid: str) -> RawSecrets:
missing_secrets = []
secrets = safe_load_secrets_from_config()
missing_secrets.extend(SUTS.get_missing_dependencies(uid, secrets=secrets))
missing_secrets.extend(SUT_FACTORY.get_missing_dependencies(uid, secrets=secrets))
raise_if_missing_from_config(missing_secrets)
return secrets

Expand Down