Skip to content

Published model cards always carry the Hub's YAML metadata - #25

Merged
engagepy merged 1 commit into
mainfrom
hf-card-metadata
Oct 23, 2026
Merged

engagepy merged 1 commit into
mainfrom
hf-card-metadata

Conversation

@engagepy

Copy link
Copy Markdown
Owner

Hugging Face showed "empty or missing yaml metadata" on M37labsorg/ade-extract-3b-v1. The export was made before model cards had front matter, and publishing uploaded it unchanged.

Changes

  • hf_upload calls fuse.ensure_card_metadata before uploading. It adds whatever is missing: YAML front matter, the licence section with limitations, LICENSE-BASE-MODEL.md and the upstream licence files. It never adds anything twice.
  • _front_matter uses the Hub's licence ids (HUB_LICENCE). Qwen's research licence becomes license: other + license_name: qwen-research + license_link, the same as Qwen's own repos. It also adds pipeline_tag: text-generation.
  • The Llama gate uses has_upstream_licence, so our own LICENSE-BASE-MODEL.md no longer counts as Meta's licence.
  • AGENTS.md and CHANGELOG are updated.

Tests

  • New regression test: an old-style Qwen export publishes with valid YAML that both yaml.safe_load and huggingface_hub.ModelCard can read. A second publish adds nothing.
  • The Llama gate test now checks that it still refuses when only LICENSE-BASE-MODEL.md is present.
  • 215 passed; ruff is clean.

🤖 Generated with Claude Code

Exports made before cards had front matter were uploaded as-is, and Hugging Face
showed "empty or missing yaml metadata". hf_upload now adds the front matter,
licence section and licence files first. The Llama gate ignores our own
LICENSE-BASE-MODEL.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: engagepy <42845567+engagepy@users.noreply.github.com>
@engagepy
engagepy merged commit 57af192 into main Oct 23, 2026
2 checks passed
@engagepy
engagepy deleted the hf-card-metadata branch October 23, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant