CI: Kill zombie diffusion processes in CI & minor code style fix on rotary embedding fallback (#13637)

This commit is contained in:
Lianmin Zheng
2025-11-20 21:57:01 +08:00
committed by GitHub
parent 852eb6ce2a
commit a352e833c4
5 changed files with 39 additions and 7 deletions
@@ -0,0 +1,27 @@
from typing import Optional
_PRIORITY_MIN = 0
_PRIORITY_MAX = 31
_LOW_PRIORITY_VALUE = "LOW"
_HIGH_PRIORITY_VALUE = "HIGH"
UNKNOWN_PRIORITY_VALUE = "UNKNOWN"
def transform_priority(priority: Optional[int]) -> str:
"""Transform the priority to a string for metrics reporting.
Limit the range to prevent high cardinality issues.
Args:
priority: The priority to transform.
Returns:
The transformed priority.
"""
if priority is None:
return UNKNOWN_PRIORITY_VALUE
elif priority < _PRIORITY_MIN:
return _LOW_PRIORITY_VALUE
elif priority >= _PRIORITY_MAX:
return _HIGH_PRIORITY_VALUE
else:
return str(priority)