hf: a lone container does not outrank weights beside it

Give --model org/repo and the engine picks what to serve from the fetched
directory: one .rad on the top level won outright, whatever else was
there -- and .rad was not in the skip list a safetensors set imposes on
.bin/.pth/.gguf, so hfget fetched the rival too. A repository that ships
a real safetensors set beside one decoy .rad chose for the operator: the
container wins, the engine loads and serves it in place of the model the
operator named.

hf_served_path no longer resolves that tie by rank -- a container among
safetensors or gguf weights is refused by name and the operator passes the
file they mean -- and hfget skips .rad when a safetensors set is present,
as it skips every other rival. A repo holding only a container still
serves it: the fix is against the silent tie-break, not against .rad.
This commit is contained in:
fl0l0u committed 2026-11-15 20:38:10 +00:00
1 parent 4c9a79ca98
commit 965a7caa51
3 files changed
+40 -4

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ bad=$(printf '%s' "$listing" | jq -r '[.[] | select(.type == "file")
[ -n "$bad" ] && { echo "hfget: the listing names '$bad', which does not land inside the destination" >&2; exit 1; }
have_st=$(printf '%s' "$listing" | jq '[.[] | select(.path | endswith(".safetensors"))] | length')
sel='.[] | select(.type == "file")'
[ "$have_st" -gt 0 ] && sel="$sel"' | select((.path | test("\\.(bin|msgpack|h5|onnx|onnx_data|gguf)$") or test("(^|/)(pytorch_model|consolidated)[^/]*\\.pth$")) | not)'
[ "$have_st" -gt 0 ] && sel="$sel"' | select((.path | test("\\.(bin|msgpack|h5|onnx|onnx_data|gguf|rad)$") or test("(^|/)(pytorch_model|consolidated)[^/]*\\.pth$")) | not)'
list=$(mktemp "${TMPDIR:-/tmp}/hfget.XXXXXX")
trap 'rm -f "$list" "$dest/.hfget-manifest.tmp"' EXIT INT TERM