[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
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user