fix: uploaded file were closed automatically before the model could infer their data

This commit is contained in:
faraphel 2025-01-10 11:05:41 +01:00
parent 639425ad7d
commit b89fafdc96
6 changed files with 62 additions and 12 deletions

View file

@ -2,5 +2,7 @@
"type": "python",
"file": "model.py",
"inputs": {}
"inputs": {
"file": {"type": "file"}
}
}

View file

@ -8,5 +8,5 @@ def load(model) -> None:
def unload(model) -> None:
pass
def infer(model) -> typing.Iterator[bytes]:
def infer(model, file) -> typing.Iterator[bytes]:
yield json.dumps({"hello": "world!"}).encode("utf-8")