Skip to content

Enhance model publishing workflow with detailed metadata and licenses#459

Merged
HenryNdubuaku merged 5 commits intomainfrom
hf_licenses
Feb 26, 2026
Merged

Enhance model publishing workflow with detailed metadata and licenses#459
HenryNdubuaku merged 5 commits intomainfrom
hf_licenses

Conversation

@jakmro
Copy link
Copy Markdown
Collaborator

@jakmro jakmro commented Feb 26, 2026

No description provided.

@jakmro jakmro marked this pull request as ready for review February 26, 2026 15:32
Copilot AI review requested due to automatic review settings February 26, 2026 15:32
@jakmro jakmro linked an issue Feb 26, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the model publishing workflow by adding detailed metadata (pipeline tags, tags, descriptions) and automatic license detection to published HuggingFace model cards. The changes improve discoverability and documentation of published models.

Changes:

  • Added YAML-based model card generation with metadata fields (base_model, pipeline_tag, tags, license, description)
  • Enhanced organization README publishing with proper YAML frontmatter for HuggingFace Spaces
  • Added LiquidAI/LFM2-8B-A1B model to the publishing configuration
  • Extended CLI to accept pipeline-tag, tags, and description arguments

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
python/src/publish_to_hf.py Added yaml import, FALLBACK_LICENSES dict, metadata handling in model card generation, frontmatter for org README, and new CLI arguments for metadata
.github/workflows/publish_to_hf.yml Updated MODELS_CONFIG with metadata for all models, added new LFM2-8B-A1B model, modified bash script to pass metadata parameters to Python script

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


publish_model() {
local model=$1 int4=$2 int8=$3 fp16=$4 apple=$5
local model=$1 int4=$2 int8=$3 fp16=$4 apple=$5 pipeline_tag=$6 tags=$7 description="${8:-}"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publish_model function signature now requires 8 parameters including pipeline_tag, tags, and description. However, the manual workflow path at lines 115-120 (not shown in this diff) only passes 5 arguments. This will cause the manual publish path to fail or pass incorrect values. Consider adding default empty values for the new parameters when called manually, or document that manual workflow dispatch is not fully supported.

Copilot uses AI. Check for mistakes.
python -m src.publish_to_hf --task export_model $FLAGS
[ -n "$pipeline_tag" ] && FLAGS="$FLAGS --pipeline-tag $pipeline_tag"
[ -n "$tags" ] && FLAGS="$FLAGS --tags $tags"
python -m src.publish_to_hf --task export_model $FLAGS --description "$description"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FLAGS variable is expanded without quotes in the command. While this is intentional to allow word splitting of the flags, if any of the values (like model names, tags, or pipeline_tag) contain spaces, this could cause incorrect argument parsing. Consider using an array instead of a string for FLAGS, or ensure that all components are properly quoted when building FLAGS.

Copilot uses AI. Check for mistakes.

try:
info = api.model_info(args.model)
source_license = (info.card_data and info.card_data.license) or FALLBACK_LICENSES.get(args.model)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license fetching logic attempts to access info.card_data.license without checking if card_data is None first. While the expression uses 'and' short-circuit evaluation correctly, if info.card_data exists but is an object without a license attribute, this could raise an AttributeError. Consider using getattr(info.card_data, 'license', None) for safer attribute access.

Suggested change
source_license = (info.card_data and info.card_data.license) or FALLBACK_LICENSES.get(args.model)
source_license = (getattr(info.card_data, "license", None) if info.card_data is not None else None) or FALLBACK_LICENSES.get(args.model)

Copilot uses AI. Check for mistakes.
@HenryNdubuaku HenryNdubuaku merged commit 9488def into main Feb 26, 2026
0 of 2 checks passed
HenryNdubuaku pushed a commit to cattermelon1234/cactus that referenced this pull request Feb 27, 2026
…cactus-compute#459)

* Enhance model publishing workflow with detailed metadata and licenses

Signed-off-by: jakmro <[email protected]>

* clean

Signed-off-by: jakmro <[email protected]>

* Update pipeline tag for Silero VAD model in publish workflow

Signed-off-by: jakmro <[email protected]>

* Update python/src/publish_to_hf.py

Co-authored-by: Copilot <[email protected]>

* Update python/src/publish_to_hf.py

Co-authored-by: Copilot <[email protected]>

---------

Signed-off-by: jakmro <[email protected]>
Co-authored-by: Copilot <[email protected]>
cattermelon1234 pushed a commit to cattermelon1234/cactus that referenced this pull request Feb 28, 2026
…cactus-compute#459)

* Enhance model publishing workflow with detailed metadata and licenses

Signed-off-by: jakmro <[email protected]>

* clean

Signed-off-by: jakmro <[email protected]>

* Update pipeline tag for Silero VAD model in publish workflow

Signed-off-by: jakmro <[email protected]>

* Update python/src/publish_to_hf.py

Co-authored-by: Copilot <[email protected]>

* Update python/src/publish_to_hf.py

Co-authored-by: Copilot <[email protected]>

---------

Signed-off-by: jakmro <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

Model Descriptions & License On HuggingFace

3 participants