feat(grouping): version-group library cards by HuggingFace repo for non-Civitai sources (#1040)

This commit is contained in:
Will Miao
2026-07-26 21:46:55 +08:00
parent 0ec7eaf606
commit 1de0a53241
16 changed files with 158 additions and 11 deletions

View File

@@ -489,6 +489,12 @@ export function createModelCard(model, modelType) {
const modelId = civitaiData?.modelId ?? civitaiData?.model_id;
if (modelId !== undefined && modelId !== null && modelId !== '') {
card.dataset.modelId = modelId;
} else if (model.hf_url) {
// For HF-only models, derive a group key from hf_url for version grouping
const match = model.hf_url.match(/https?:\/\/huggingface\.co\/([^/]+\/[^/]+)/);
if (match) {
card.dataset.modelId = 'hf:' + match[1];
}
}
// LoRA specific data