Baichuan 7b

From VectorSpaceLab/AREX-Skill · View interactive version

Baichuan 7b is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Operate Baichuan-7B model loading, architecture inspection, C-Eval/MMLU evaluation preflights, and DeepSpeed pretraining setup from self-contained repo guidance.

How to use this skill

Skill file

Baichuan-7B Repo Skill

Use this skill when a task involves the Baichuan-7B repository, its custom Transformers model code, official Hugging Face loading pattern, C-Eval/MMLU benchmark scripts, or DeepSpeed pretraining demo. The skill is self-contained for operating decisions; do not reopen the original README or source scripts unless the user's active task is explicitly to edit a checkout.

Route by task

| User intent | Read | Why |

|---|---|---|

| Load Baichuan-7B, inspect BaiChuanConfig, debug generation/cache behavior, or run a tiny architecture smoke | architecture-and-loading | Owns model classes, config defaults, trust_remote_code loading, and safe local-source checks. |

| Prepare C-Eval or MMLU evaluation, validate benchmark layout, render commands, or interpret output files | evaluation-workflows | Owns Chinese/English benchmark preflights, dataset layout, output artifacts, and benchmark-specific failures. |

| Prepare pretraining data, validate tokenizer.model, DeepSpeed JSON/hostfile, render launch commands, or explain checkpoints | pretraining-and-deepspeed | Owns corpus sharding, tokenizer placement, DeepSpeed setup, and safe training dry-runs. |

| Check class signatures, dependency surfaces, or source-derived architecture facts shared across workflows | API reference | Summarizes verified public classes, signatures, model dimensions, and script surfaces. |

| Diagnose install/import/backend/model-weight problems before choosing a sub-skill | troubleshooting | Covers cross-cutting dependency pins, CUDA/xFormers, model assets, datasets, and training resource boundaries. |

| Decide whether this skill is stale for a checkout | repo provenance | Records the commit, dirty state, dependency pins, and evidence paths used to create this skill. |

Operating assumptions

Setup checklist for a later runtime

  1. Choose the workflow route above before installing optional packages.
  2. Install the repo-documented stack when feasible: deepspeed==0.9.2, numpy==1.23.5, sentencepiece==0.1.97, torch==2.0.0, transformers==4.29.1, and xformers==0.0.20. If newer CUDA/Torch wheels are required, treat compatibility as a runtime decision and run the safe checks again.
  3. For architecture-only checks, run the tiny smoke from the architecture sub-skill; it needs no official weights or datasets.
  4. For real inference or evaluation, ensure the model identifier or local model directory contains compatible weights, config, tokenizer assets, and trusted remote-code files.
  5. For benchmark runs, validate C-Eval or MMLU prerequisites with the evaluation preflight helper before loading the model.
  6. For pretraining, validate corpus shards, tokenizer.model, DeepSpeed config, hostfile, and checkpoint path before rendering or launching any command.

Safe first checks

Architecture-only smoke against an active Baichuan-style checkout:

python sub-skills/architecture-and-loading/scripts/local_model_smoke.py --repo-root /path/to/Baichuan-7B

Benchmark preflight without executing inference:

python sub-skills/evaluation-workflows/scripts/check_evaluation_inputs.py ceval --model /path/to/model --shot 5 --split val

Training preflight without launching DeepSpeed:

python sub-skills/pretraining-and-deepspeed/scripts/validate_training_inputs.py \
  --data-dir /path/to/data_dir \
  --tokenizer-path /path/to/tokenizer.model \
  --deepspeed-config /path/to/deepspeed.json \
  --hostfile /path/to/hostfile

Stop conditions

Stop and ask for explicit user resources before:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.