[Bugfix] Restore model info caching for package backends (#52690)

Signed-off-by: haoyang.qian <haoyangqian@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
hy123
2026-08-19 11:18:10 +00:00
committed by GitHub
co-authored by OpenAI Codex
parent cba06764d7
commit b160cab156
2 changed files with 32 additions and 1 deletions
+2 -1
View File
@@ -1004,9 +1004,10 @@ class _LazyRegisteredModel(_BaseRegisteredModel):
# hardware-isolated ``vllm.models.<name>`` layout) live outside
# ``vllm/model_executor/models``. Resolve the module spec directly
# so the file-hash cache stays warm for them.
model_path: Path | None = None
if self.module_name.startswith("vllm.model_executor.models."):
model_path = Path(__file__).parent / f"{self.module_name.split('.')[-1]}.py"
else:
if model_path is None or not model_path.exists():
try:
spec = importlib.util.find_spec(self.module_name)
except (ImportError, ValueError):