[Bugfix][v1] Fix step pooler implementation and step pooling usage in v1 (#19956)

Signed-off-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
Isotr0py
2025-06-23 18:38:06 +00:00
committed by GitHub
parent 68aaeb3749
commit 61f4fc5dc6
14 changed files with 164 additions and 40 deletions
+6
View File
@@ -489,6 +489,12 @@ def supports_cross_encoding(
return is_pooling_model(model) and _supports_cross_encoding(model)
def has_step_pooler(model: Union[type[object], object]) -> bool:
"""Check if the model uses step pooler."""
return is_pooling_model(model) and any(
type(module).__name__ == "StepPool" for module in model.modules())
class SupportsQuant:
"""The interface required for all models that support quantization."""