[Misc] remove unused try-except in pooling config check (#21618)

Signed-off-by: reidliu41 <reid201711@gmail.com>
This commit is contained in:
Reid 2025-07-26 20:20:03 +08:00 committed by GitHub
parent 875af38e01
commit 05c1126f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -574,13 +574,11 @@ def get_pooling_config_name(pooling_name: str) -> Union[str, None]:
supported_pooling_types = ['LAST', 'ALL', 'CLS', 'STEP', 'MEAN']
pooling_type_name = pooling_name.upper()
try:
if pooling_type_name in supported_pooling_types:
return pooling_type_name
except NotImplementedError as e:
logger.debug("Pooling type not supported", e)
return None
return None
if pooling_type_name in supported_pooling_types:
return pooling_type_name
raise NotImplementedError(
f"Pooling type {pooling_type_name} not supported")
@cache