UX: clean loggings (#22174)

This commit is contained in:
Mick
2026-04-08 09:46:38 +08:00
committed by GitHub
parent 117508dcd7
commit eca62ab8f4
4 changed files with 8 additions and 9 deletions
@@ -259,7 +259,7 @@ class MistralModel(nn.Module):
mask_function = create_causal_mask
causal_mask = mask_function(
config=self.config,
input_embeds=inputs_embeds,
inputs_embeds=inputs_embeds,
attention_mask=attention_mask,
cache_position=cache_position,
past_key_values=past_key_values,
@@ -434,7 +434,7 @@ class Qwen2_5_VLTextModel(nn.Module):
# Prepare mask arguments
mask_kwargs = {
"config": self.config,
"input_embeds": inputs_embeds,
"inputs_embeds": inputs_embeds,
"attention_mask": attention_mask,
"cache_position": cache_position,
"past_key_values": past_key_values,
@@ -562,6 +562,7 @@ def globally_suppress_loggers():
"urllib3",
"httpx",
"httpcore",
"flash_attn.cute.cache_utils",
]
for name in target_names:
+5 -7
View File
@@ -3,7 +3,7 @@
from typing import Any
import orjson
from fastapi.responses import ORJSONResponse, Response
from fastapi.responses import Response
# Keep response serialization behavior consistent across endpoints:
# - Support non-string dictionary keys used in some metadata payloads.
@@ -16,17 +16,15 @@ def dumps_json(content: Any) -> bytes:
return orjson.dumps(content, option=ORJSON_RESPONSE_OPTIONS)
class SGLangORJSONResponse(ORJSONResponse):
class SGLangORJSONResponse(Response):
"""ORJSON response with SGLang-specific serialization options."""
media_type = "application/json"
def render(self, content: Any) -> bytes:
return dumps_json(content)
def orjson_response(content: Any, status_code: int = 200) -> Response:
"""Create a JSON response with stable ORJSON serialization options."""
return Response(
content=dumps_json(content),
media_type="application/json",
status_code=status_code,
)
return SGLangORJSONResponse(content=content, status_code=status_code)