rust-ml-huggingface-porting

Detect and resolve tensor naming mismatches when porting HuggingFace models to Candle.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/gar-ai/mallorn --skill rust-ml-huggingface-porting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-ml-huggingface-porting
Source: https://github.com/gar-ai/mallorn/tree/main/.claude/skills/rust-ml-huggingface-porting
Command: npx skills add https://github.com/gar-ai/mallorn --skill rust-ml-huggingface-porting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Port HuggingFace models to Candle with correct tensor naming to prevent weight-loading and matmul errors during integration.

Core Features & Use Cases

  • Pattern catalog: Catalogs common tensor name patterns across HuggingFace families to identify naming mismatches.
  • Prefix-detection: Detects presence or absence of model prefix (model.) and adjusts paths accordingly.
  • Contiguity fixes: Guides how to enforce tensor contiguity before matmul to avoid runtime errors.
  • Use Case: Debugs weight loading in safetensors when converting models to Candle.

Quick Start

Use this skill to inspect a HuggingFace safetensors file and apply correct naming patterns to ensure Candle loads weights without error.

Frequently Asked Questions about rust-ml-huggingface-porting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does weight loading fail when porting HuggingFace models to Candle?

Weight loading fails during HuggingFace porting to Candle due to tensor naming mismatches between checkpoints. The skill identifies these mismatches using pattern detection and prefix handling to ensure robust safetensors loading.

How do I fix tensor naming mismatches in safetensors for Candle?

Fix tensor naming mismatches in safetensors by applying runtime pattern detection and adjusting model prefix paths. This skill catalogs common tensor name patterns across HuggingFace families to resolve weight loading errors.

What causes matmul failures after converting HuggingFace checkpoints to Rust?

Matmul failures occur when tensors lack contiguity before operations in Candle. Enforce tensor contiguity to avoid runtime errors, and verify tensor naming patterns to ensure correct weight loading from safetensors.

How do I detect and adjust the model prefix when loading safetensors in Candle?

Detect the model prefix by checking for the presence or absence of the 'model.' string in tensor names. The skill handles prefix detection automatically, adjusting tensor paths accordingly to align HuggingFace checkpoints with Candle.

Does this skill support debugging tensor naming across all HuggingFace model families?

The skill catalogs common tensor name patterns across various HuggingFace families to identify naming mismatches. It applies runtime pattern detection to resolve weight loading and matmul errors across different safetensors checkpoints.