stdout from the running model is now visible from the manager stdout

This commit is contained in:
faraphel 2025-01-19 18:54:47 +01:00
parent 156db5d6a1
commit e833342581
2 changed files with 7 additions and 2 deletions

View file

@ -45,6 +45,7 @@ class PythonModel(base.BaseModel):
self._process = subprocess.Popen( self._process = subprocess.Popen(
[ [
"conda", "run", # run a command within conda "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 "--prefix", self.environment.relative_to(self.path), # use the model environment
"python3", "-c", # run a python command "python3", "-c", # run a python command

View file

@ -1,4 +1,6 @@
import inspect import inspect
import typing
import fastapi import fastapi
@ -24,8 +26,10 @@ def load(parameters_definition: dict[str, dict]) -> list[inspect.Parameter]:
match definition["type"]: match definition["type"]:
case "file": case "file":
# shortcut for uploading a file # shortcut for uploading a file
definition["type"] = fastapi.UploadFile definition["type"] = typing.Annotated[
fastapi.UploadFile,
fastapi.File()
]
# deserialize the parameter # deserialize the parameter
parameter = inspect.Parameter( parameter = inspect.Parameter(