diff --git a/source/model/PythonModel.py b/source/model/PythonModel.py index c80095b..d2a5b2b 100644 --- a/source/model/PythonModel.py +++ b/source/model/PythonModel.py @@ -45,6 +45,7 @@ class PythonModel(base.BaseModel): self._process = subprocess.Popen( [ "conda", "run", # run a command within conda + "--no-capture-output", # make conda not capture stdout, allow us to see the stdout "--prefix", self.environment.relative_to(self.path), # use the model environment "python3", "-c", # run a python command diff --git a/source/utils/parameters.py b/source/utils/parameters.py index 69d8fff..ce97040 100644 --- a/source/utils/parameters.py +++ b/source/utils/parameters.py @@ -1,4 +1,6 @@ import inspect +import typing + import fastapi @@ -24,8 +26,10 @@ def load(parameters_definition: dict[str, dict]) -> list[inspect.Parameter]: match definition["type"]: case "file": # shortcut for uploading a file - definition["type"] = fastapi.UploadFile - + definition["type"] = typing.Annotated[ + fastapi.UploadFile, + fastapi.File() + ] # deserialize the parameter parameter = inspect.Parameter(