mirror of
https://git.isriupjv.fr/ISRI/ai-server
synced 2025-04-24 18:18:11 +02:00
stdout from the running model is now visible from the manager stdout
This commit is contained in:
parent
156db5d6a1
commit
e833342581
2 changed files with 7 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue