[Bugfix] Retry config read to survive concurrent HF cache refresh (#49001)

Signed-off-by: pei.zhang <pei.zhang@amd.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
peizhang56
2026-07-22 15:35:38 -07:00
committed by GitHub
co-authored by Claude
parent 910cc8543a
commit 7d10a4cfce
+11 -7
View File
@@ -731,13 +731,17 @@ def get_config(
raise ValueError(error_message) from e
config_parser = get_config_parser(config_format)
config_dict, config = config_parser.parse(
model,
trust_remote_code=trust_remote_code,
revision=revision,
code_revision=code_revision,
hf_overrides=hf_overrides_kw or hf_overrides_fn,
**kwargs,
# Retry to tolerate a concurrent HF cache refresh briefly hiding config.json.
config_dict, config = with_retry(
lambda: config_parser.parse(
model,
trust_remote_code=trust_remote_code,
revision=revision,
code_revision=code_revision,
hf_overrides=hf_overrides_kw or hf_overrides_fn,
**kwargs,
),
f"Error parsing config for {model}",
)
# Architecture mapping for models without explicit architectures field