sgl-project/sglang · error · FileNotFoundError
Resolved LoRA weight {selected_file!r} was not downloaded to
Error message
Resolved LoRA weight {selected_file!r} was not downloaded to {local_path} What it means
maybe_download_lora downloads the resolved LoRA repo snapshot into local_path and then verifies selected_file landed on disk. If the expected file is missing after download (filtered out by allow_patterns, partial download, unexpected repo layout), FileNotFoundError.
Source
Thrown at python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py:680
return source.local_path
return os.path.join(source.local_path, selected_file)
assert source.repo_id is not None
allow_patterns = ["*.json", selected_file]
selected_parent = os.path.dirname(selected_file)
if selected_parent:
allow_patterns.insert(1, f"{selected_parent}/*.json")
local_path = maybe_download_model(
source.repo_id,
local_dir,
download,
is_lora=True,
allow_patterns=allow_patterns,
revision=resolved_weight.inventory.resolved_revision or source.revision,
)
target = os.path.join(local_path, selected_file)
if not os.path.isfile(target):
raise FileNotFoundError(
f"Resolved LoRA weight {selected_file!r} was not downloaded to {local_path}"
)
return target
def verify_model_config_and_directory(model_path: str) -> dict[str, Any]:
"""
Verify that the model directory contains a valid diffusers configuration.
Args:
model_path: Path to the model directory
Returns:
The loaded model configuration as a dictionary
"""
# Check for model_index.json which is required for diffusers models
config_path = os.path.join(model_path, "model_index.json")View on GitHub (pinned to 0132848349)
Solutions
- Retry once after clearing the partial HF cache entry for the LoRA repo
- Verify the file exists in the repo at the resolved revision (huggingface-cli repo-files or web UI) and that its path matches the selected weight name
- Pre-download the LoRA locally and pass the local path + exact weight_name
Defensive patterns
Strategy: retry
Validate before calling
import os assert os.path.isfile(os.path.join(local_path, selected_file)), 'download incomplete'
Try / catch
for attempt in range(2):
try:
return maybe_download_lora(...)
except FileNotFoundError:
clear_hf_cache_entry(repo); continue Prevention
- Pre-download LoRAs locally before serving
- Verify repo file layout matches selected weight paths
When it happens
Trigger: Calling load_lora_adapter on a remote LoRA repo where the resolved selected_file does not match the downloaded allow_patterns, or the download silently failed / was interrupted.
Common situations: HF repo restructured so the weight sits outside the patterns; flaky network yielding an incomplete snapshot; revision mismatch between resolve and download steps.
Related errors
- LoRA pinned weight cache key collision for {cache_key!r}: ca
- Got LoRA adapter that has never been loaded: {lora_path}\nAl
- LoRA batch_info must provide max_len or seg_lens.
- LoRA batch_info must provide max_len or seg_lens.
- lora_nickname cannot be empty
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/17dc1e2e073900bf.
Report an issue: GitHub.