AGENT SKILL

gpt2-chinese

Routes GPT2-Chinese training, generation, perplexity evaluation, and tokenizer or vocabulary workflows.

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

01 前言 Front Matter

name
gpt2-chinese
license
MIT
metadata
{ "disco-role": "operating" }
description
Routes GPT2-Chinese training, generation, perplexity evaluation, and tokenizer or vocabulary workflows.
disable-model-invocation
true

02 资源文件 9

03 SKILL.md 正文

GPT2-Chinese

Use this repo skill when the task is about the GPT2-Chinese repository or its Chinese GPT-2 workflows.

Start here

  • Read references/repo-provenance.md before deciding whether this skill matches the checkout you are using.
  • Read references/workflows.md for the end-to-end training, evaluation, generation, and tokenizer flows.
  • Read references/cli-reference.md for the exact CLI flags and default paths.
  • Read references/model-overview.md when choosing a config file or vocabulary bundle.
  • Run scripts/check_install.py after installing dependencies or when imports look suspicious.

Install baseline

The repo is not packaged as a wheel. A typical working setup is:

  1. Install a compatible PyTorch build for your machine.
  2. Install the repo runtime dependencies from requirements.txt.
  3. Add tensorboard, sentencepiece, and scikit-learn when they are missing.
  4. Use the bundled smoke script to confirm the checkout can import and instantiate the tiny model.

See references/troubleshooting.md if train.py --help warns about missing optional packages, if generate.py cannot find a model directory, or if the word-level tokenizer cannot locate its dictionary.

Routing

Training and perplexity

Read sub-skills/training/SKILL.md when the user wants to:

  • train from train.json or another JSON-list corpus
  • use --raw preprocessing or the single-corpus training path
  • resume from a checkpoint
  • evaluate perplexity with eval.py
  • reason about output_dir, tokenized_data_path, log_step, gradient_accumulation, or fp16

Generation

Read sub-skills/generation/SKILL.md when the user wants to:

  • generate text from a checkpoint
  • compare generate.py and generate_texts.py
  • choose prefix, topk, topp, temperature, or fast_pattern
  • save samples to files or diagnose repeated or hanging generation

Tokenizers and vocabulary

Read sub-skills/tokenization/SKILL.md when the user wants to:

  • choose between char/BERT, word-level, or BPE tokenization
  • build or replace a vocabulary file
  • understand cache/vocab_*.txt, tokenizations/*.py, or the legacy vocabulary builder
  • fix path-sensitive tokenizer or dictionary issues

How to use the sub-skills

  • Start with the narrowest sub-skill that matches the user request.
  • If a request spans training plus generation, read the training sub-skill first and then the generation sub-skill.
  • If the request includes vocabulary generation or tokenizer selection, read the tokenization sub-skill before training or generation so the config and vocabulary stay aligned.
  • Use the bundled helper scripts rather than source-checkout paths when a workflow can be checked locally.
  • Keep generated outputs inside the current checkout or the user-specified artifact area; do not put review or test artifacts inside this skill directory.

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