[Model] Migrate MammothModa2 DiT to the shared diffusion runtime (#7134)

Signed-off-by: levius <2114377220@qq.com>
Signed-off-by: Yueqian Lin <linyueqian@outlook.com>
Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
Co-authored-by: Yueqian Lin <linyueqian@outlook.com>
This commit is contained in:
authored and GitHub committed 2026-09-18 13:29:18 -07:00
1 parent ca3ccfc9a3
commit 7b4fc7ce2e
16 files changed
+1046 -427

No files matched your search

+27 -1
View File
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""Tests for endpoint restrictions logic."""
import pytest
@@ -44,6 +44,32 @@ def test_restricted_completions_returns_400():
assert body["error"]["type"] == "BadRequestError"
def test_restricted_image_edits_returns_400():
"""Ensure pipelines can reject image edits independently of generation."""
app = FastAPI()
@app.post("/v1/images/edits")
async def existing_handler():
return {"ok": True}
@app.post("/v1/images/generations")
async def generations_handler():
return {"ok": True}
restrictions = (EndpointRestriction(OmniServingCapability.IMAGE_EDITS, REJECTION_REASON),)
shutdown_unsupported_routes(app, restrictions)
client = TestClient(app)
resp = client.post("/v1/images/edits")
assert resp.status_code == 400
assert resp.json()["error"]["message"] == REJECTION_REASON
# The restriction is endpoint-specific and must not remove generations.
resp = client.post("/v1/images/generations")
assert resp.status_code == 200
assert resp.json() == {"ok": True}
def test_unrestricted_completions_not_blocked():
"""Ensure that if we don't shutdown any routes, the route stays."""
app = _make_app_with_server_route()