CI / test (push) Failing after 7m17s
From review. A mirror set already on the node is looked at again, not trusted for having been fetched once; Pickled cuts a query or a fragment from any source, hf: too; .pt2 is a pickle. The flag check reads a flag as the engine does: underscores as dashes and any beginning of a refused flag as that flag, since argparse takes --trust-remote for --trust-remote-code; SGLang refuses --load-format, which would undo the agent's safetensors. TripoSR's preset says allow_pickle: without it the preset could not be added and the presets pass failed on it each time. A shared ComfyUI environment's hidden entry takes its first member's allow_pickle, as it takes its source. The GenAI trace attributes made temperature and top_p typed fields of the request's parse, so "0.7" as a string was a 400; they are read loosely, as they are read only for the trace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package catalog
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestAModelInAPickleFormatIsRefusedUnlessItSaysSo(t *testing.T) {
|
|
m := Model{Name: "triposr", Source: "hf:stabilityai/TripoSR/model.ckpt",
|
|
Adapters: []Adapter{{Name: "a", Source: "http://m/a/adapter_model.bin"}}}
|
|
err := m.CheckPickle()
|
|
if err == nil || !strings.Contains(err.Error(), "model.ckpt") || !strings.Contains(err.Error(), "allow_pickle") {
|
|
t.Fatalf("not refused, or not said why: %v", err)
|
|
}
|
|
if got := m.PickleSources(); len(got) != 2 {
|
|
t.Errorf("pickle sources %v, want the model's and the adapter's", got)
|
|
}
|
|
// A source that was there before is not asked about again: changing
|
|
// the scaling of a model that runs does not need allow_pickle.
|
|
if err := m.CheckPickle(m.PickleSources()...); err != nil {
|
|
t.Errorf("sources already there were refused: %v", err)
|
|
}
|
|
m.AllowPickle = true
|
|
if err := m.CheckPickle(); err != nil {
|
|
t.Errorf("allow_pickle was not honoured: %v", err)
|
|
}
|
|
if err := (Model{Name: "q", Source: "http://m/q/v/q-Q4_K_M.gguf"}).CheckPickle(); err != nil {
|
|
t.Errorf("a GGUF was refused: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestTheTripoSRPresetSaysItsCheckpointIsAllowed(t *testing.T) {
|
|
p, ok := PresetNamed("triposr")
|
|
if !ok {
|
|
t.Fatal("no triposr preset")
|
|
}
|
|
if err := p.Model.CheckPickle(); err != nil {
|
|
t.Errorf("the preset llmgw ships is refused by its own check: %v", err)
|
|
}
|
|
}
|