Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
32 lines
897 B
Go
32 lines
897 B
Go
package gguf
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
// Run by hand against the real adapter this was written for:
|
|
//
|
|
// LLMGW_LIVE_GGUF=1 go test ./internal/gguf -run LiveAdapter -v
|
|
func TestLiveAdapterIsAnAdapter(t *testing.T) {
|
|
if os.Getenv("LLMGW_LIVE_GGUF") == "" {
|
|
t.Skip("set LLMGW_LIVE_GGUF to read a real adapter from Hugging Face")
|
|
}
|
|
h, err := KindFromURL(t.Context(), nil,
|
|
"https://huggingface.co/ggml-org/LoRA-Qwen2.5-Coder-7B-Instruct-F16-GGUF/resolve/main/LoRA-Qwen2.5-Coder-7B-Instruct-f16.gguf")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !h.IsAdapter() || h.Architecture != "qwen2" {
|
|
t.Errorf("%+v", h)
|
|
}
|
|
m, err := KindFromURL(t.Context(), nil,
|
|
"https://huggingface.co/bartowski/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/Qwen2.5-0.5B-Instruct-Q4_K_M.gguf")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if m.IsAdapter() || m.Architecture != "qwen2" {
|
|
t.Errorf("a model read as %+v", m)
|
|
}
|
|
}
|