model-reconstruction
Guide Chinese-LLaMA-Alpaca asset selection, checksum validation, tokenizer extension, and LoRA reconstruction into PTH or Hugging Face model formats.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-reconstruction
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guide Chinese-LLaMA-Alpaca asset selection, checksum validation, tokenizer extension, and LoRA reconstruction into PTH or Hugging Face model formats.
- disable-model-invocation
- true
02 资源文件 8
- 参考文档references/checksums.md3.6 KB
- 参考文档references/model-assets.md3.8 KB
- 参考文档references/reconstruction-workflows.md3.7 KB
- 参考文档references/troubleshooting.md3.9 KB
- 脚本scripts/chinese_sp.model507.8 KB
- 脚本scripts/merge_llama_with_chinese_lora_low_mem.py14.5 KB
- 脚本scripts/merge_llama_with_chinese_lora.py14.4 KB
- 脚本scripts/merge_tokenizers.py2.8 KB
03 SKILL.md 正文
Model Reconstruction Router
Use this sub-skill when a user needs to prepare Chinese-LLaMA-Alpaca model assets, merge Chinese LoRA adapters with legally obtained original LLaMA weights, extend tokenizers, choose PTH versus Hugging Face output, or debug reconstruction failures. The commands below assume the current working directory is this sub-skill directory.
The repository releases Chinese LLaMA/Alpaca LoRA adapters and tokenizers, not original full LLaMA weights. Do not imply the skill can supply original LLaMA weights or bypass license restrictions. Real reconstruction is large and should run only after the user confirms asset paths, disk/RAM budget, output format, and license constraints.
Fast Route
- Confirm assets and model family. Read
references/model-assets.mdfor original LLaMA, Chinese LLaMA, Chinese Alpaca, Plus/Pro, tokenizer, and multi-LoRA compatibility. - Verify downloads before merging. Use the root helper
../../scripts/verify_sha256.pywith checksums fromreferences/checksums.md. - Choose the conversion path. Use
references/reconstruction-workflows.md:- standard merge:
python scripts/merge_llama_with_chinese_lora.py ... - low-memory or ordered multi-LoRA merge:
python scripts/merge_llama_with_chinese_lora_low_mem.py ... - tokenizer extension:
python scripts/merge_tokenizers.py ...
- standard merge:
- Use bundled scripts only. The copied scripts in
scripts/replace the source checkout scripts for runtime use. - Troubleshoot before retrying. Read
references/troubleshooting.mdfor tokenizer/vocab mismatch, PEFT version, RAM/disk, shard, and checksum problems.
Bundled Runtime Files
scripts/merge_llama_with_chinese_lora.py: standard LoRA merge topthor Hugging Face format.scripts/merge_llama_with_chinese_lora_low_mem.py: low-memory merge with ordered comma-separated LoRA paths.scripts/merge_tokenizers.py: Chinese tokenizer vocabulary extension; defaults to bundledscripts/chinese_sp.model.references/checksums.md: distilled SHA256 table and verification workflow.
Scope Boundaries
- Route inference, Gradio, FastAPI, OpenAI-compatible API, and LangChain prompts to
../inference-deployment/after a merged or loadable model exists. - Route new LoRA training or SFT data preparation to
../training-finetuning/. - Route C-Eval and example benchmark interpretation to
../evaluation-benchmarks/. - Do not run model reconstruction from a vague request. Ask for base model path, LoRA path(s), tokenizer expectations, output type, output directory, and available memory/disk first.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).