noqt commited on
Commit
a4f6f8c
·
1 Parent(s): 8b52128

Accept pinned interpreter symlink in Safetensors smoke

Browse files
Files changed (1) hide show
  1. scripts/smoke_safetensors_ai.py +5 -1
scripts/smoke_safetensors_ai.py CHANGED
@@ -36,8 +36,12 @@ def load_assets(path: Path) -> tuple[Path, Path, Path, dict[str, Any]]:
36
  python = Path(value["environment"]["path"])
37
  model = Path(value["model"]["path"])
38
  config = Path(value["model"]["config"])
39
- if any(item.is_symlink() or not item.is_file() for item in (python, model, config)):
40
  raise RuntimeError("Safetensors smoke assets are not regular files")
 
 
 
 
41
  if digest(model) != value["model"]["sha256"] or digest(config) != value["model"]["config_sha256"]:
42
  raise RuntimeError("Safetensors smoke asset digest differs from manifest")
43
  return python, model, config, value
 
36
  python = Path(value["environment"]["path"])
37
  model = Path(value["model"]["path"])
38
  config = Path(value["model"]["config"])
39
+ if any(item.is_symlink() or not item.is_file() for item in (model, config)):
40
  raise RuntimeError("Safetensors smoke assets are not regular files")
41
+ if python.is_symlink():
42
+ python = python.resolve()
43
+ if python.is_symlink() or not python.is_file() or not os.access(python, os.X_OK):
44
+ raise RuntimeError("Safetensors smoke interpreter is not executable")
45
  if digest(model) != value["model"]["sha256"] or digest(config) != value["model"]["config_sha256"]:
46
  raise RuntimeError("Safetensors smoke asset digest differs from manifest")
47
  return python, model, config, value