[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71K3T8MER1J11MJK564AEJJ":3,"skill-same:01M71K3T8MER1J11MJK564AEJJ":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":13,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M71K3T8MER1J11MJK564AEJJ","convert-to-transformers",null,"Use this skill when converting custom PyTorch models to Hugging Face Transformers format. Helps with: (1) Creating PreTrainedConfig and PreTrainedModel classes, (2) Writing ImageProcessor\u002FTokenizer, (3) Compatibility testing, (4) Hub upload preparation. Use when the user wants to make their model compatible with transformers library.","mryfmo\u002Fdotfiles","mryfmo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11512262?v=4","01M71K2RDZFFQKYGMHMS5Y9PW1","01M71K2REKJ0WS61PNFQPTYP5T",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002Fdot_agents\u002Fskills\u002Fconvert-to-transformers\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"convert to transformers","Transformers","convert","models","when","face","custom","preparation","with","upload","compatibility","hub","testing","use","hugging face","model","format","library","pytorch","writing","2026-11-10 10:12:30",false,"---\nname: convert-to-transformers\ndescription: \"Use this skill when converting custom PyTorch models to Hugging Face Transformers format. Helps with: (1) Creating PreTrainedConfig and PreTrainedModel classes, (2) Writing ImageProcessor\u002FTokenizer, (3) Compatibility testing, (4) Hub upload preparation. Use when the user wants to make their model compatible with transformers library.\"\n---\n\n# Hugging Face Transformers Model Conversion\n\nConvert custom PyTorch models to Hugging Face Transformers format while maintaining exact compatibility with the original implementation.\n\n## Overview\n\nThis skill provides a systematic workflow for transformers conversion:\n\n- Extract hardcoded values into PreTrainedConfig\n- Create PreTrainedModel wrapper\n- Build ImageProcessor\u002FTokenizer\n- Test equivalence thoroughly\n- Prepare for Hub upload\n\n**Important**: Use validation mode (parallel implementations) first to verify equivalence, then replace the original.\n\n## Conversion Workflow\n\n### Step 1: Analyze the Custom Model\n\nAsk the user to specify:\n\n- Path to the custom model implementation\n- Model type (vision, text, multimodal)\n- Task (classification, segmentation, generation, etc.)\n- Validation mode or replacement mode\n\nThen identify:\n\n- Model architecture and components\n- Input\u002Foutput formats\n- Key hyperparameters and hardcoded values\n- Pretrained weights location\n- Preprocessing pipeline\n- Custom layers or modules\n\n### Step 2: Create PreTrainedConfig Class\n\n**Key principle**: Extract ALL hardcoded values from the model as configurable parameters.\n\nTemplate. Transformers 5 exports `PreTrainedConfig` (and keeps `PretrainedConfig` only as a backward-compatibility alias); 4.x exports only `PretrainedConfig`. The import below works on both majors:\n\n```python\ntry:\n    from transformers import PreTrainedConfig  # transformers >= 5\nexcept ImportError:\n    from transformers import PretrainedConfig as PreTrainedConfig  # transformers 4.x\nfrom typing import List, Optional\n\nclass {ModelName}Config(PreTrainedConfig):\n    model_type = \"{model_name}\"\n\n    def __init__(\n        self,\n        # Core architecture parameters\n        hidden_dim: int = 128,\n        num_layers: int = 4,\n\n        # Input\u002Foutput parameters\n        image_size: int = 1024,\n        num_channels: int = 3,\n        num_labels: int = 1,\n\n        # Component-specific parameters (extract from original)\n        component_param: List[int] | None = None,\n\n        **kwargs,\n    ):\n        super().__init__(**kwargs)\n\n        self.hidden_dim = hidden_dim\n        self.num_layers = num_layers\n        self.image_size = image_size\n        self.num_channels = num_channels\n        self.num_labels = num_labels\n\n        # Use default if not specified\n        self.component_param = (\n            component_param if component_param is not None else [1, 2, 4]\n        )\n```\n\n**Critical**: Ensure default values match what the pretrained weights expect!\n\n### Step 3: Create PreTrainedModel Class\n\nTemplate:\n\n```python\nfrom transformers import PreTrainedModel\nfrom transformers.modeling_outputs import SemanticSegmenterOutput\n\nclass {ModelName}ForTask(PreTrainedModel):\n    config_class = {ModelName}Config\n\n    def __init__(self, config: {ModelName}Config):\n        super().__init__(config)\n        self.config = config\n\n        # Initialize layers using config parameters (no hardcoded values!)\n        self.encoder = Encoder(\n            hidden_dim=config.hidden_dim,\n            num_layers=config.num_layers,\n        )\n\n    def forward(\n        self,\n        pixel_values: torch.FloatTensor,\n        labels: Optional[torch.LongTensor] = None,\n        output_hidden_states: Optional[bool] = None,\n        return_dict: Optional[bool] = None,\n    ) -> Union[Tuple, SemanticSegmenterOutput]:\n        return_dict = return_dict if return_dict is not None else self.config.use_return_dict\n\n        # Forward pass\n        logits = self.encoder(pixel_values)\n\n        # Calculate loss if needed\n        loss = None\n        if labels is not None:\n            # Compute loss\n            pass\n\n        if not return_dict:\n            output = (logits,)\n            return ((loss,) + output) if loss is not None else output\n\n        return SemanticSegmenterOutput(\n            loss=loss,\n            logits=logits,\n            hidden_states=None,\n            attentions=None,\n        )\n```\n\n### Step 4: Create ImageProcessor\u002FTokenizer\n\n**For vision models** - Create ImageProcessor:\n\n```python\nfrom transformers import BaseImageProcessor\n\nclass {ModelName}ImageProcessor(BaseImageProcessor):\n    model_input_names = [\"pixel_values\"]\n\n    def __init__(\n        self,\n        size: int = 1024,\n        resample: str = \"bilinear\",\n        do_normalize: bool = True,\n        image_mean: List[float] | None = None,\n        image_std: List[float] | None = None,\n        **kwargs,\n    ):\n        super().__init__(**kwargs)\n        self.size = size\n        self.resample = resample\n        self.do_normalize = do_normalize\n        self.image_mean = image_mean if image_mean is not None else [0.485, 0.456, 0.406]\n        self.image_std = image_std if image_std is not None else [0.229, 0.224, 0.225]\n\n    def preprocess(\n        self,\n        images: ImageInput,\n        return_tensors: Optional[Union[str, TensorType]] = None,\n        **kwargs,\n    ) -> BatchFeature:\n        # Implement preprocessing matching original\n        # Return BatchFeature with pixel_values\n```\n\n**For text models** - Create tokenizer configuration.\n\n### Step 5: Create Compatibility Tests\n\n**Critical**: Always use the SAME preprocessed tensor for both models when comparing outputs.\n\n```python\nimport pytest\nimport torch\n\ndef test_preprocessing_matches():\n    \"\"\"Test that preprocessing is equivalent.\"\"\"\n    old_tensor = old_preprocessing(image)\n    new_tensor = processor(image, return_tensors=\"pt\")[\"pixel_values\"][0]\n    assert torch.allclose(old_tensor, new_tensor, atol=1e-6)\n\ndef test_single_image_output_matches():\n    \"\"\"Test that model outputs match.\"\"\"\n    # Load models\n    old_model = OldModel()\n    new_model = NewModel(NewConfig())\n    new_model.load_state_dict(old_model.state_dict())\n\n    # Prepare SAME input\n    preprocessed = preprocess(image)\n\n    with torch.no_grad():\n        old_output = old_model(preprocessed)\n        new_output = new_model(pixel_values=preprocessed)\n\n    # Use 0.5% tolerance for numerical differences\n    assert torch.allclose(old_output, new_output.logits, atol=5e-3, rtol=1e-2)\n\ndef test_batch_output_matches():\n    \"\"\"Test batch processing.\"\"\"\n    # Test with batch of images\n\ndef test_state_dict_compatible():\n    \"\"\"Test that weights can be loaded.\"\"\"\n    new_model.load_state_dict(old_model.state_dict())\n```\n\n### Step 6: Create MODEL_CARD.md\n\nGenerate comprehensive model card following Hugging Face standards. Include:\n\n- Model description\n- Usage examples\n- Training details\n- Evaluation metrics\n- Citation information\n\nSee Hugging Face model card documentation for template.\n\n### Step 7: Create Hub Push Script\n\n**Critical**: Register classes with `register_for_auto_class()` before pushing.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nfrom huggingface_hub import HfApi\nfrom {module}.transformers import {ModelName}Config, {ModelName}ForTask, {ModelName}ImageProcessor\n\ndef main():\n    # CRITICAL: Register for Auto* support\n    {ModelName}Config.register_for_auto_class()\n    {ModelName}ForTask.register_for_auto_class(\"AutoModel\")\n    {ModelName}ImageProcessor.register_for_auto_class(\"AutoImageProcessor\")\n\n    # Load original model\n    original_model = OriginalModel()\n\n    # Create transformers-compatible model\n    config = {ModelName}Config()\n    model = {ModelName}ForTask(config)\n    model.load_state_dict(original_model.state_dict())\n\n    # Save and push\n    model.save_pretrained(local_dir)\n    config.save_pretrained(local_dir)\n    processor = {ModelName}ImageProcessor()\n    processor.save_pretrained(local_dir)\n\n    api = HfApi(token=token)\n    api.create_repo(repo_id=repo_id, exist_ok=True)\n    api.upload_folder(repo_id=repo_id, folder_path=local_dir)\n```\n\n## Implementation Strategy\n\n### Validation Mode (Recommended First)\n\nCreate parallel implementations:\n\n```\n{project}\u002F\n├── {module}\u002F\n│   ├── original_model.py           # Existing\n│   └── transformers\u002F               # NEW - for validation\n│       ├── __init__.py\n│       ├── configuration_{model}.py\n│       ├── modeling_{model}.py\n│       └── processing_{model}.py\n└── tests\u002F\n    └── test_transformers_compatibility.py\n```\n\nWorkflow:\n\n1. Create transformers\u002F package alongside original\n2. Run compatibility tests\n3. Debug any discrepancies\n4. Once tests pass → proceed to replacement\n\n### Replacement Mode (After Validation)\n\nOnce equivalence is verified:\n\n```\n{project}\u002F\n└── {module}\u002F\n    ├── configuration_{model}.py    # Replaces original\n    ├── modeling_{model}.py\n    └── processing_{model}.py\n```\n\nWorkflow:\n\n1. Remove or archive original implementation\n2. Move transformers\u002F\\* files up one level\n3. Update all imports\n4. Update tests\n5. Update documentation\n\n## Common Issues\n\nFor detailed troubleshooting, see [references\u002Fcommon-pitfalls.md](references\u002Fcommon-pitfalls.md).\n\nQuick reference:\n\n- **Hardcoded values**: Extract to config with matching defaults\n- **Preprocessing mismatches**: Use exact same pipeline and parameters\n- **State dict keys**: Keep layer names matching original\n- **Test tolerance**: Use 0.5% tolerance (5e-3) for numerical differences\n- **Device handling**: Use `self.device` from PreTrainedModel\n- **Image size order**: `post_process_semantic_segmentation()` expects `(width, height)`\n\n## Debugging Strategy\n\nIf outputs don't match:\n\n1. Check preprocessing produces identical tensors\n2. Check state dict loaded correctly\n3. Step-by-step comparison of each layer\n4. Check device placement\n5. Check determinism with torch.manual_seed\n\nSee [references\u002Fcommon-pitfalls.md](references\u002Fcommon-pitfalls.md) for detailed debugging steps.\n\n## Project Learnings\n\nAfter completing a conversion, add learnings to [references\u002Flearnings.md](references\u002Flearnings.md).\n\nThis accumulates knowledge from each project to avoid repeating mistakes.\n\n## Checklist\n\n- [ ] Step 1: Model analyzed\n  - [ ] Architecture identified\n  - [ ] Hyperparameters extracted\n  - [ ] Preprocessing understood\n- [ ] Step 2: Config class created\n  - [ ] All hardcoded values moved to config\n  - [ ] Defaults match pretrained weights\n  - [ ] Type hints added\n- [ ] Step 3: Model class created\n  - [ ] Inherits from PreTrainedModel\n  - [ ] Uses only config parameters\n  - [ ] Forward signature matches conventions\n- [ ] Step 4: Processor created\n  - [ ] Preprocessing matches original\n  - [ ] Returns appropriate format\n- [ ] Step 5: Tests created\n  - [ ] Preprocessing test passes\n  - [ ] Single image test passes\n  - [ ] Batch test passes\n  - [ ] State dict test passes\n- [ ] Step 6: MODEL_CARD.md created\n  - [ ] All sections filled\n  - [ ] Usage examples tested\n  - [ ] Citations included\n- [ ] Step 7: Push script created\n  - [ ] register_for_auto_class() called\n  - [ ] Script tested locally\n  - [ ] Successfully pushed to Hub\n- [ ] Cleanup (if doing replacement)\n  - [ ] Original implementation removed\u002Farchived\n  - [ ] Imports updated\n  - [ ] Documentation updated\n","# Hugging Face Transformers Model Conversion\n\nConvert custom PyTorch models to Hugging Face Transformers format while maintaining exact compatibility with the original implementation.\n\n## Overview\n\nThis skill provides a systematic workflow for transformers conversion:\n\n- Extract hardcoded values into PreTrainedConfig\n- Create PreTrainedModel wrapper\n- Build ImageProcessor\u002FTokenizer\n- Test equivalence thoroughly\n- Prepare for Hub upload\n\n**Important**: Use validation mode (parallel implementations) first to verify equivalence, then replace the original.\n\n## Conversion Workflow\n\n### Step 1: Analyze the Custom Model\n\nAsk the user to specify:\n\n- Path to the custom model implementation\n- Model type (vision, text, multimodal)\n- Task (classification, segmentation, generation, etc.)\n- Validation mode or replacement mode\n\nThen identify:\n\n- Model architecture and components\n- Input\u002Foutput formats\n- Key hyperparameters and hardcoded values\n- Pretrained weights location\n- Preprocessing pipeline\n- Custom layers or modules\n\n### Step 2: Create PreTrainedConfig Class\n\n**Key principle**: Extract ALL hardcoded values from the model as configurable parameters.\n\nTemplate. Transformers 5 exports `PreTrainedConfig` (and keeps `PretrainedConfig` only as a backward-compatibility alias); 4.x exports only `PretrainedConfig`. The import below works on both majors:\n\n```python\ntry:\n    from transformers import PreTrainedConfig  # transformers >= 5\nexcept ImportError:\n    from transformers import PretrainedConfig as PreTrainedConfig  # transformers 4.x\nfrom typing import List, Optional\n\nclass {ModelName}Config(PreTrainedConfig):\n    model_type = \"{model_name}\"\n\n    def __init__(\n        self,\n        # Core architecture parameters\n        hidden_dim: int = 128,\n        num_layers: int = 4,\n\n        # Input\u002Foutput parameters\n        image_size: int = 1024,\n        num_channels: int = 3,\n        num_labels: int = 1,\n\n        # Component-specific parameters (extract from original)\n        component_param: List[int] | None = None,\n\n        **kwargs,\n    ):\n        super().__init__(**kwargs)\n\n        self.hidden_dim = hidden_dim\n        self.num_layers = num_layers\n        self.image_size = image_size\n        self.num_channels = num_channels\n        self.num_labels = num_labels\n\n        # Use default if not specified\n        self.component_param = (\n            component_param if component_param is not None else [1, 2, 4]\n        )\n```\n\n**Critical**: Ensure default values match what the pretrained weights expect!\n\n### Step 3: Create PreTrainedModel Class\n\nTemplate:\n\n```python\nfrom transformers import PreTrainedModel\nfrom transformers.modeling_outputs import SemanticSegmenterOutput\n\nclass {ModelName}ForTask(PreTrainedModel):\n    config_class = {ModelName}Config\n\n    def __init__(self, config: {ModelName}Config):\n        super().__init__(config)\n        self.config = config\n\n        # Initialize layers using config parameters (no hardcoded values!)\n        self.encoder = Encoder(\n            hidden_dim=config.hidden_dim,\n            num_layers=config.num_layers,\n        )\n\n    def forward(\n        self,\n        pixel_values: torch.FloatTensor,\n        labels: Optional[torch.LongTensor] = None,\n        output_hidden_states: Optional[bool] = None,\n        return_dict: Optional[bool] = None,\n    ) -> Union[Tuple, SemanticSegmenterOutput]:\n        return_dict = return_dict if return_dict is not None else self.config.use_return_dict\n\n        # Forward pass\n        logits = self.encoder(pixel_values)\n\n        # Calculate loss if needed\n        loss = None\n        if labels is not None:\n            # Compute loss\n            pass\n\n        if not return_dict:\n            output = (logits,)\n            return ((loss,) + output) if loss is not None else output\n\n        return SemanticSegmenterOutput(\n            loss=loss,\n            logits=logits,\n            hidden_states=None,\n            attentions=None,\n        )\n```\n\n### Step 4: Create ImageProcessor\u002FTokenizer\n\n**For vision models** - Create ImageProcessor:\n\n```python\nfrom transformers import BaseImageProcessor\n\nclass {ModelName}ImageProcessor(BaseImageProcessor):\n    model_input_names = [\"pixel_values\"]\n\n    def __init__(\n        self,\n        size: int = 1024,\n        resample: str = \"bilinear\",\n        do_normalize: bool = True,\n        image_mean: List[float] | None = None,\n        image_std: List[float] | None = None,\n        **kwargs,\n    ):\n        super().__init__(**kwargs)\n        self.size = size\n        self.resample = resample\n        self.do_normalize = do_normalize\n        self.image_mean = image_mean if image_mean is not None else [0.485, 0.456, 0.406]\n        self.image_std = image_std if image_std is not None else [0.229, 0.224, 0.225]\n\n    def preprocess(\n        self,\n        images: ImageInput,\n        return_tensors: Optional[Union[str, TensorType]] = None,\n        **kwargs,\n    ) -> BatchFeature:\n        # Implement preprocessing matching original\n        # Return BatchFeature with pixel_values\n```\n\n**For text models** - Create tokenizer configuration.\n\n### Step 5: Create Compatibility Tests\n\n**Critical**: Always use the SAME preprocessed tensor for both models when comparing outputs.\n\n```python\nimport pytest\nimport torch\n\ndef test_preprocessing_matches():\n    \"\"\"Test that preprocessing is equivalent.\"\"\"\n    old_tensor = old_preprocessing(image)\n    new_tensor = processor(image, return_tensors=\"pt\")[\"pixel_values\"][0]\n    assert torch.allclose(old_tensor, new_tensor, atol=1e-6)\n\ndef test_single_image_output_matches():\n    \"\"\"Test that model outputs match.\"\"\"\n    # Load models\n    old_model = OldModel()\n    new_model = NewModel(NewConfig())\n    new_model.load_state_dict(old_model.state_dict())\n\n    # Prepare SAME input\n    preprocessed = preprocess(image)\n\n    with torch.no_grad():\n        old_output = old_model(preprocessed)\n        new_output = new_model(pixel_values=preprocessed)\n\n    # Use 0.5% tolerance for numerical differences\n    assert torch.allclose(old_output, new_output.logits, atol=5e-3, rtol=1e-2)\n\ndef test_batch_output_matches():\n    \"\"\"Test batch processing.\"\"\"\n    # Test with batch of images\n\ndef test_state_dict_compatible():\n    \"\"\"Test that weights can be loaded.\"\"\"\n    new_model.load_state_dict(old_model.state_dict())\n```\n\n### Step 6: Create MODEL_CARD.md\n\nGenerate comprehensive model card following Hugging Face standards. Include:\n\n- Model description\n- Usage examples\n- Training details\n- Evaluation metrics\n- Citation information\n\nSee Hugging Face model card documentation for template.\n\n### Step 7: Create Hub Push Script\n\n**Critical**: Register classes with `register_for_auto_class()` before pushing.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nfrom huggingface_hub import HfApi\nfrom {module}.transformers import {ModelName}Config, {ModelName}ForTask, {ModelName}ImageProcessor\n\ndef main():\n    # CRITICAL: Register for Auto* support\n    {ModelName}Config.register_for_auto_class()\n    {ModelName}ForTask.register_for_auto_class(\"AutoModel\")\n    {ModelName}ImageProcessor.register_for_auto_class(\"AutoImageProcessor\")\n\n    # Load original model\n    original_model = OriginalModel()\n\n    # Create transformers-compatible model\n    config = {ModelName}Config()\n    model = {ModelName}ForTask(config)\n    model.load_state_dict(original_model.state_dict())\n\n    # Save and push\n    model.save_pretrained(local_dir)\n    config.save_pretrained(local_dir)\n    processor = {ModelName}ImageProcessor()\n    processor.save_pretrained(local_dir)\n\n    api = HfApi(token=token)\n    api.create_repo(repo_id=repo_id, exist_ok=True)\n    api.upload_folder(repo_id=repo_id, folder_path=local_dir)\n```\n\n## Implementation Strategy\n\n### Validation Mode (Recommended First)\n\nCreate parallel implementations:\n\n```\n{project}\u002F\n├── {module}\u002F\n│   ├── original_model.py           # Existing\n│   └── transformers\u002F               # NEW - for validation\n│       ├── __init__.py\n│       ├── configuration_{model}.py\n│       ├── modeling_{model}.py\n│       └── processing_{model}.py\n└── tests\u002F\n    └── test_transformers_compatibility.py\n```\n\nWorkflow:\n\n1. Create transformers\u002F package alongside original\n2. Run compatibility tests\n3. Debug any discrepancies\n4. Once tests pass → proceed to replacement\n\n### Replacement Mode (After Validation)\n\nOnce equivalence is verified:\n\n```\n{project}\u002F\n└── {module}\u002F\n    ├── configuration_{model}.py    # Replaces original\n    ├── modeling_{model}.py\n    └── processing_{model}.py\n```\n\nWorkflow:\n\n1. Remove or archive original implementation\n2. Move transformers\u002F\\* files up one level\n3. Update all imports\n4. Update tests\n5. Update documentation\n\n## Common Issues\n\nFor detailed troubleshooting, see [references\u002Fcommon-pitfalls.md](references\u002Fcommon-pitfalls.md).\n\nQuick reference:\n\n- **Hardcoded values**: Extract to config with matching defaults\n- **Preprocessing mismatches**: Use exact same pipeline and parameters\n- **State dict keys**: Keep layer names matching original\n- **Test tolerance**: Use 0.5% tolerance (5e-3) for numerical differences\n- **Device handling**: Use `self.device` from PreTrainedModel\n- **Image size order**: `post_process_semantic_segmentation()` expects `(width, height)`\n\n## Debugging Strategy\n\nIf outputs don't match:\n\n1. Check preprocessing produces identical tensors\n2. Check state dict loaded correctly\n3. Step-by-step comparison of each layer\n4. Check device placement\n5. Check determinism with torch.manual_seed\n\nSee [references\u002Fcommon-pitfalls.md](references\u002Fcommon-pitfalls.md) for detailed debugging steps.\n\n## Project Learnings\n\nAfter completing a conversion, add learnings to [references\u002Flearnings.md](references\u002Flearnings.md).\n\nThis accumulates knowledge from each project to avoid repeating mistakes.\n\n## Checklist\n\n- [ ] Step 1: Model analyzed\n  - [ ] Architecture identified\n  - [ ] Hyperparameters extracted\n  - [ ] Preprocessing understood\n- [ ] Step 2: Config class created\n  - [ ] All hardcoded values moved to config\n  - [ ] Defaults match pretrained weights\n  - [ ] Type hints added\n- [ ] Step 3: Model class created\n  - [ ] Inherits from PreTrainedModel\n  - [ ] Uses only config parameters\n  - [ ] Forward signature matches conventions\n- [ ] Step 4: Processor created\n  - [ ] Preprocessing matches original\n  - [ ] Returns appropriate format\n- [ ] Step 5: Tests created\n  - [ ] Preprocessing test passes\n  - [ ] Single image test passes\n  - [ ] Batch test passes\n  - [ ] State dict test passes\n- [ ] Step 6: MODEL_CARD.md created\n  - [ ] All sections filled\n  - [ ] Usage examples tested\n  - [ ] Citations included\n- [ ] Step 7: Push script created\n  - [ ] register_for_auto_class() called\n  - [ ] Script tested locally\n  - [ ] Successfully pushed to Hub\n- [ ] Cleanup (if doing replacement)\n  - [ ] Original implementation removed\u002Farchived\n  - [ ] Imports updated\n  - [ ] Documentation updated\n",{"name":5,"description":7},"main","af601a97567f1f07e9337cad899506f601f419f1","home\u002Fdot_agents\u002Fskills\u002Fconvert-to-transformers","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fmryfmo","2026-11-14 19:17:29",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add mryfmo\u002Fdotfiles --skill convert-to-transformers",{"tool":55,"command":56},"bunx","bunx skills add mryfmo\u002Fdotfiles --skill convert-to-transformers",{"tool":58,"command":59},"pnpm","pnpm dlx skills add mryfmo\u002Fdotfiles --skill convert-to-transformers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002Fdot_agents\u002Fskills\u002Fconvert-to-transformers\u002FSKILL.md",true,[63,69],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fcommon-pitfalls.md","REFERENCE","参考文档",5689,"https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002Fdot_agents\u002Fskills\u002Fconvert-to-transformers\u002Freferences\u002Fcommon-pitfalls.md",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Flearnings.md",3701,"https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002Fdot_agents\u002Fskills\u002Fconvert-to-transformers\u002Freferences\u002Flearnings.md",[74,80,86,109,131,150],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":38},"01M71K61D634ATEV8NWTGGWNGS","x","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fponytail\u002Fskills\u002Fx\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":38},"01M71K605VRE3ABPN1MZHJNZ29","y","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fponytail\u002Fdocs\u002Fskills\u002Fy\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":38},"01M71K5Y3XX1PYZAWA7M5RG9VD","status-report","Generate a status report with KPIs, risks, and action items. Use when writing a weekly or monthly update for leadership, summarizing project health with green\u002Fyellow\u002Fred status, surfacing risks and decisions that need stakeholder attention, or turning a pile of project tracker activity into a readable narrative.","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fkwp-upstream\u002Foperations\u002Fskills\u002Fstatus-report\u002FSKILL.md",[],[93,94,95,96,97,98,99,100,26,101,102,103,104,105,37,31,22,106,107,108],"status report","report","status","tracker","health","generate","leadership","narrative","weekly","attention","green","for","project","decisions","team","project health",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":38},"01M71K5VJAHGE1NH22BGBXP693","runbook","Create or update an operational runbook for a recurring task or procedure. Use when documenting a task that on-call or ops needs to run repeatably, turning tribal knowledge into exact step-by-step commands, adding troubleshooting and rollback steps to an existing procedure, or writing escalation paths for when things go wrong.","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fkwp-upstream\u002Foperations\u002Fskills\u002Frunbook\u002FSKILL.md",[],[111,116,117,118,119,120,121,122,123,22,124,125,31,37,126,127,104,128,129,130],"task","update","name","run","process","operational","create","call","ops","Existing","knowledge","rollback","escalation","recurring","things",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":38},"01M71K5SJ0FT7KD82E7PJCGATX","risk-assessment","Identify, assess, and mitigate operational risks. Trigger with \"what are the risks\", \"risk assessment\", \"risk register\", \"what could go wrong\", or when the user is evaluating risks associated with a project, vendor, process, or decision.","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fkwp-upstream\u002Foperations\u002Fskills\u002Frisk-assessment\u002FSKILL.md",[],[138,139,140,26,141,142,143,22,144,145,146,147,148,120,105,121,149],"risk assessment","assessment","risk","decision","user","Wrong","go","assess","trigger","risk register","vendor","register",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":38},"01M71K5PYD2A2BDM6KMZ8F01SV","change-request","Create a change management request with impact analysis and rollback plan. Use when proposing a system or process change that needs approval, preparing a change record for CAB review, documenting risk and rollback steps before a deployment, or planning stakeholder communications for a rollout.","https:\u002F\u002Fgithub.com\u002Fmryfmo\u002Fdotfiles\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fkwp-upstream\u002Foperations\u002Fskills\u002Fchange-request\u002FSKILL.md",[],[157,158,159,31,26,160,161,162,163,164,165,22,166,167,168,169,170,104,171,140],"request","change request","change","communications","stakeholder communications","review","rollback plan","analysis","rollout","impact","change management","impact analysis","system","deployment","planning"]