Spaces:
Running
Running
Accept pinned interpreter symlink in Safetensors smoke
Browse files35 unmodified lines363738394041424335 unmodified linespython = Path(value["environment"]["path"])model = Path(value["model"]["path"])config = Path(value["model"]["config"])if any(item.is_symlink() or not item.is_file() for item in (python, model, config)):raise RuntimeError("Safetensors smoke assets are not regular files")if digest(model) != value["model"]["sha256"] or digest(config) != value["model"]["config_sha256"]:raise RuntimeError("Safetensors smoke asset digest differs from manifest")return python, model, config, value35 unmodified lines36373839404142434445464735 unmodified linespython = Path(value["environment"]["path"])model = Path(value["model"]["path"])config = Path(value["model"]["config"])if any(item.is_symlink() or not item.is_file() for item in (model, config)):raise RuntimeError("Safetensors smoke assets are not regular files")if python.is_symlink():python = python.resolve()if python.is_symlink() or not python.is_file() or not os.access(python, os.X_OK):raise RuntimeError("Safetensors smoke interpreter is not executable")if digest(model) != value["model"]["sha256"] or digest(config) != value["model"]["config_sha256"]:raise RuntimeError("Safetensors smoke asset digest differs from manifest")return python, model, config, value
scripts/smoke_safetensors_ai.py+5-1