[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:
@@ -731,13 +731,17 @@ def get_config(
|
|||||||
raise ValueError(error_message) from e
|
raise ValueError(error_message) from e
|
||||||
|
|
||||||
config_parser = get_config_parser(config_format)
|
config_parser = get_config_parser(config_format)
|
||||||
config_dict, config = config_parser.parse(
|
# Retry to tolerate a concurrent HF cache refresh briefly hiding config.json.
|
||||||
model,
|
config_dict, config = with_retry(
|
||||||
trust_remote_code=trust_remote_code,
|
lambda: config_parser.parse(
|
||||||
revision=revision,
|
model,
|
||||||
code_revision=code_revision,
|
trust_remote_code=trust_remote_code,
|
||||||
hf_overrides=hf_overrides_kw or hf_overrides_fn,
|
revision=revision,
|
||||||
**kwargs,
|
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
|
# Architecture mapping for models without explicit architectures field
|
||||||
|
|||||||
Reference in New Issue
Block a user