Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mlserver/parallel/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ def _ignore_signals(self):
To avoid this, and be able to properly shut them down, we forcefully
ignore the signals coming from the main parent process.
"""
loop = asyncio.get_event_loop()
# Fix for Python 3.10.10+ / 3.11+ compatibility where asyncio.get_event_loop()
# no longer creates a new loop automatically in child process threads, causing
# RuntimeError when uvloop is active in worker processes.
try:
loop = asyncio.get_event_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

for sign in IGNORED_SIGNALS:
# Ensure that signal handlers are a no-op, to let the main process
Expand Down
7,020 changes: 3,795 additions & 3,225 deletions poetry.lock

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mlserver"
version = "1.6.1"
version = "1.6.2"
description = "MLServer"
authors = ["Seldon Technologies Ltd. <hello@seldon.io>"]
license = "Apache-2.0"
Expand Down Expand Up @@ -43,7 +43,7 @@ asyncio_mode = "auto"
addopts = "--import-mode=importlib"

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
python = ">=3.11,<3.12"
click = "*"
fastapi = ">=0.88.0,!=0.89.0,<=0.110.0"
python-dotenv = "*"
Expand All @@ -68,9 +68,11 @@ pydantic-settings = "2.2.1"
python-multipart = "*"
h11 = "0.16.*"
werkzeug = "^3.0.6"
keras = "3.*"
# Replaced keras with tf-keras for transformers compatibility
tf-keras = ">=2.16.0"
filelock = "3.20.1"

# Explicitly add setuptools pinned below v80 to preserve pkg_resources
setuptools = ">=68.0.0,<=80.0.0"
## The importlib-resources backport is required to use some
## functionality added in Python 3.10
## https://setuptools.pypa.io/en/latest/userguide/datafiles.html#accessing-data-files-at-runtime
Expand All @@ -88,7 +90,7 @@ tox = "4.14.2"

[tool.poetry.group.dev.dependencies]
datamodel-code-generator = "0.25.5"
grpcio-tools = "1.48.2"
grpcio-tools = "^1.62.0"
pytest = "7.4.4"
pytest-asyncio = "0.21.1"
pytest-mock = "3.12.0"
Expand All @@ -107,7 +109,7 @@ conda-pack = "0.7.1"
flake8 = "7.0.0"
flake8-black = "0.3.6"
mypy = "1.10.0"
mypy-protobuf = "3.1.0"
mypy-protobuf = ">=3.4.0"
types-protobuf = "5.26.0.20240422"
types-orjson = "3.6.2"
types-aiofiles = "23.2.0.20240106"
Expand All @@ -119,7 +121,7 @@ filelock = "^3.13.1"
httpx-sse = "^0.3.1"

[tool.poetry.group.docker.dependencies]
protobuf = "3.20.3"
protobuf = "^4.21.6"
# tensorflow = "<2.15" #TODO(strive): is this really needed?

[tool.poetry.group.all-runtimes]
Expand All @@ -144,10 +146,10 @@ requests-mock = "~1.11.0"
types-requests = ">=2.28.11.5,<2.32.0.0"

## Dev dependencies from MLflow
torch = "2.2.1"
torch = "2.3.1"
pytorch-lightning = "2.3.1"
torchmetrics = "1.4.0.post0"
torchvision = "0.17.1"
torchvision = "0.18.1"
mlflow = "2.13.1"

## Dev dependencies from HuggingFace
Expand Down
33 changes: 33 additions & 0 deletions runtimes/huggingface/mlserver_huggingface/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,39 @@
],
outputs=[],
),
"zero-shot-object-detection": dict(
inputs=[
# File path inputs (e.g., local image paths or URLs)
MetadataTensor(
name="array_inputs",
shape=[-1],
datatype="BYTES",
parameters=dict(content_type="str"),
),
# File content bytes inputs (e.g., raw base64 image strings)
MetadataTensor(
name="array_inputs",
shape=[-1],
datatype="BYTES",
parameters=dict(content_type="base64"),
),
# Raw pixel matrix inputs (e.g., preprocessed NumPy/Torch tensors)
MetadataTensor(
name="array_inputs",
shape=[-1],
datatype="FP32",
parameters=dict(content_type="nplist"),
),
# Candidate text labels/prompts for object detection
MetadataTensor(
name="candidate_labels",
shape=[-1],
datatype="BYTES",
parameters=dict(content_type="str"),
),
],
outputs=[],
),
"image-classification": dict(
inputs=[
# file path inputs
Expand Down
5,387 changes: 2,955 additions & 2,432 deletions runtimes/huggingface/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions runtimes/huggingface/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.poetry]
name = "mlserver-huggingface"
version = "2.1.0"
version = "2.1.1"
description = "HuggingFace runtime for MLServer"
authors = ["Seldon Technologies Ltd. <hello@seldon.io>"]
license = "Apache-2.0"
readme = "README.md"
packages = [{include = "mlserver_huggingface"}]

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
python = ">=3.11,<3.12"
mlserver = "*"
tensorflow = "*"
pillow = "*"
Expand Down
Loading
Loading