Files
cloudpods/pkg/llm/models/instantmodel_modelscope_test.go
Zexi Li 9cc4d76a81 feat(llm): add ModelScope instant model import and refactor model download (#25092)
Add ModelScope hub integration, download driver, and instant model import
flow parallel to HuggingFace. Extract shared HuggingFace download helpers
and reuse them across vLLM/SGLang container drivers.
2026-07-01 20:13:17 +08:00

30 lines
794 B
Go

package models
import (
"testing"
)
func TestNormalizeModelScopeOpenAPISearchResults(t *testing.T) {
items := []modelScopeOpenAPIModel{
{Id: "Qwen/Qwen3-0.6B", Downloads: 10, Likes: 2, Tasks: []string{"text-generation"}},
{Id: "org/gguf-model", Tags: []string{"library:gguf"}},
}
out := normalizeModelScopeOpenAPISearchResults(items)
if len(out) != 2 {
t.Fatalf("len=%d", len(out))
}
if out[0].ModelId != "Qwen/Qwen3-0.6B" || !out[0].Supported {
t.Fatalf("first=%+v", out[0])
}
if out[1].Supported {
t.Fatalf("gguf should be unsupported: %+v", out[1])
}
}
func TestResolveModelCatalogSourceCustomURL(t *testing.T) {
custom := "https://example.com/catalog.yaml"
if got := resolveModelCatalogSource(custom); got != custom {
t.Fatalf("got=%q want=%q", got, custom)
}
}