address issues building mlflow model in GHA test env
This commit is contained in:
Andrew Tolopko
2022-07-29 11:17:04 -04:00
committed by GitHub
parent 03d9e8e6aa
commit a9ef01a6f9
3 changed files with 21 additions and 14 deletions
+5
View File
@@ -0,0 +1,5 @@
from .mlflow_model_fixture import FakeModel
def _load_pyfunc(data_path):
return FakeModel()
@@ -0,0 +1,11 @@
import mlflow
class FakeModel(mlflow.pyfunc.PythonModel):
def __init__(self, input_to_output: dict = {}):
self.input_to_output = input_to_output
def predict(self, model_input) -> None:
# this stdout output is useful for validating the input in a test, noting that this model will be invoked in a
# subprocess, so stdout is one means of communicating information back to the test code
print(f"__MODEL_INPUT__={model_input.iloc[0][0]}")