From f218234e4f19323d09f10c03505a89a82d52ebd4 Mon Sep 17 00:00:00 2001 From: Mick Date: Thu, 5 Feb 2026 09:22:26 +0800 Subject: [PATCH] [diffusion] chore: prohibit Chinese characters usage (#18249) --- .pre-commit-config.yaml | 8 ++++++++ .../sglang/multimodal_gen/runtime/models/encoders/t5.py | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7abe48029..cb70d9213 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,6 +67,14 @@ repos: - '--extra-keys=metadata.kernelspec metadata.language_info.version' - repo: local hooks: + - id: check-chinese-characters + name: check chinese characters in multimodal_gen + entry: >- + python3 -c 'import sys, re; p=re.compile(r"[\u4e00-\u9fff]"); ec=0; [ ([(print(f"{f}:{i+1}: {l.strip()}") or (ec:=1)) for i,l in enumerate(open(f, "r", encoding="utf-8", errors="ignore")) if p.search(l)]) for f in sys.argv[1:] ]; sys.exit(ec)' + language: system + files: ^python/sglang/multimodal_gen/.* + exclude: ^(python/sglang/multimodal_gen/configs/sample|python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/workflows|python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages)(/|$) + types_or: [python, markdown, json, text] - id: sort-ci-permissions name: sort CI_PERMISSIONS.json entry: python3 .github/update_ci_permission.py --sort-only diff --git a/python/sglang/multimodal_gen/runtime/models/encoders/t5.py b/python/sglang/multimodal_gen/runtime/models/encoders/t5.py index c502c0340..1ea509648 100644 --- a/python/sglang/multimodal_gen/runtime/models/encoders/t5.py +++ b/python/sglang/multimodal_gen/runtime/models/encoders/t5.py @@ -63,9 +63,6 @@ class AttentionType: ENCODER_DECODER = "encoder_decoder" -_seen_keys = set() # 用集合记录已经出现过的 key - - @dataclass class AttentionMetadata: attn_bias: torch.Tensor