[Bugfix] Skip generation config fallback for GGUF to prevent multi-process hang (#30209)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Christina Norman 2025-12-08 19:52:43 -06:00 committed by GitHub
parent 7b35011ad1
commit e41312a2f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -954,6 +954,13 @@ def try_get_generation_config(
revision: str | None = None,
config_format: str | ConfigFormat = "auto",
) -> GenerationConfig | None:
# GGUF files don't have generation_config.json - their config is embedded
# in the file header. Skip all filesystem lookups to avoid re-reading the
# memory-mapped file, which can hang in multi-process scenarios when the
# EngineCore process already has the file mapped.
if is_gguf(model):
return None
try:
return GenerationConfig.from_pretrained(
model,