AGENT SKILL

model-loading

Load HFL Chinese BERT-wwm family models with Transformers or PaddleHub while avoiding RoBERTa-class and offline-cache mistakes.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
model-loading
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Load HFL Chinese BERT-wwm family models with Transformers or PaddleHub while avoiding RoBERTa-class and offline-cache mistakes.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

model-loading

Use this sub-skill when a task is about loading or validating HFL Chinese BERT-wwm family model identifiers, choosing the correct MODEL_NAME or PaddleHub MODULE_NAME, checking whether a model is available in an offline Hugging Face cache, or fixing errors caused by using RoBERTa classes for RoBERTa-wwm-named checkpoints.

Route here for

  • hfl/chinese-bert-wwm, hfl/chinese-bert-wwm-ext, hfl/chinese-roberta-wwm-ext, hfl/chinese-roberta-wwm-ext-large, hfl/rbt3, hfl/rbt4, hfl/rbt6, or hfl/rbtl3 loading.
  • Deciding between BertTokenizer/BertModel and AutoTokenizer/AutoModel for these identifiers.
  • Explaining why RobertaTokenizer or RobertaModel is wrong for these models despite names containing RoBERTa.
  • Distinguishing TensorFlow checkpoint zips from Hugging Face/PyTorch files.
  • PaddleHub module-name lookup and optional Paddle/PaddleHub dependency caveats.
  • Offline-safe model-id validation or cache checks with the bundled helper.

Route elsewhere

  • Fine-tuning hyperparameters, task/model selection, WWM interpretation, and benchmark-driven model choice: ../task-selection-and-finetuning/SKILL.md.
  • Dataset schemas, dataset availability, and benchmark table interpretation: ../data-and-benchmarks/SKILL.md.
  • Cross-cutting environment, cache, proxy, and framework issues that are not specific to these loading workflows: ../../references/troubleshooting.md.

Operating pattern

  1. Identify whether the user is using Hugging Face Transformers, PaddleHub, or a downloaded checkpoint zip.
  2. Normalize the requested model to a supported HFL id or PaddleHub module name using references/loading-workflows.md.
  3. For Transformers, prefer BertTokenizer plus BertModel, or AutoTokenizer plus AutoModel. Do not use RobertaTokenizer or RobertaModel for this repository's Chinese RoBERTa-wwm family.
  4. Decide the loading mode before calling from_pretrained:
    • offline/cache validation: use local_files_only=True or the bundled checker's default offline mode;
    • online download: make the network action explicit and ensure the user expects checkpoint downloads;
    • local checkpoint directory: verify the directory contains files matching the framework path being used.
  5. If the goal is only to validate a model id or check local cache state, run scripts/check_transformers_model.py instead of writing ad hoc loading code.

Bundled helper

Run the checker from this sub-skill directory or provide its path explicitly:

python scripts/check_transformers_model.py --help
python scripts/check_transformers_model.py hfl/rbt3 --try-load-tokenizer --offline-only
python scripts/check_transformers_model.py --model-id hfl/chinese-roberta-wwm-ext --try-load-config --allow-download

The helper validates the bundled model-id map and imports the expected Transformers classes. It does not download by default. It exits nonzero for unknown ids, missing imports/backends, or any requested config/tokenizer/model load that fails.

References

  • references/loading-workflows.md: model-id and PaddleHub mappings, offline/online/cache workflows, and checkpoint-format notes.
  • references/api-reference.md: verified public APIs and signatures for the minimum Transformers workflow.
  • references/troubleshooting.md: workflow-specific failure diagnosis and fixes.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351