chinese-llama-alpaca
Route Chinese-LLaMA-Alpaca model reconstruction, inference/deployment, training/fine-tuning, and evaluation workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- chinese-llama-alpaca
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route Chinese-LLaMA-Alpaca model reconstruction, inference/deployment, training/fine-tuning, and evaluation workflows.
- disable-model-invocation
- true
02 资源文件 8
- 参考文档references/compliance-and-limitations.md1.5 KB
- 参考文档references/environment-and-installation.md2.1 KB
- 参考文档references/model-family-overview.md2.0 KB
- 参考文档references/repo-provenance.md1.7 KB
- 参考文档references/repo-routing-metadata.json564 B
- 参考文档references/troubleshooting.md2.6 KB
- 脚本scripts/check_environment.py3.7 KB
- 脚本scripts/verify_sha256.py2.1 KB
03 SKILL.md 正文
Chinese-LLaMA-Alpaca Repo Skill
Use this repo skill when a task involves the original Chinese-LLaMA-Alpaca project: Chinese LLaMA/Alpaca LoRA adapters, tokenizer expansion, LoRA reconstruction, local Transformers inference, Gradio or OpenAI-compatible serving, LangChain demos, PEFT pretraining/SFT, C-Eval, or the repo's example benchmark tables. The command examples below assume the current working directory is this generated skill root.
This skill is self-contained for workflow guidance and bundled helper scripts, but it does not provide original LLaMA weights, Chinese LoRA downloads, C-Eval data, API keys, or permission to use restricted assets commercially. Always confirm asset/license, hardware, network, service, and budget constraints before running heavyweight commands.
Start Here
- Read
references/repo-provenance.mdwhen checking freshness against a repository checkout. - Read
references/model-family-overview.mdto choose Chinese LLaMA versus Chinese Alpaca, size, Plus/Pro, and tokenizer family. - Read
references/environment-and-installation.mdbefore creating an environment or installing optional dependencies. - Run
scripts/check_environment.pyfor a safe dependency/backend probe. - Use
scripts/verify_sha256.pywith the checksum reference when checking downloaded model/tokenizer assets. - Use
references/troubleshooting.mdfor cross-cutting install/import/asset/backend failures. - Use
references/compliance-and-limitations.mdbefore publishing outputs or advising on commercial/safety-sensitive use.
Route Map
| User request | Use |
|---|---|
| "Merge Chinese Alpaca LoRA with LLaMA", "convert to HF/PTH", "tokenizer mismatch", "verify adapter checksum" | sub-skills/model-reconstruction/ |
| "Run inference", "batch predictions", "interactive single-turn", "Gradio demo", "OpenAI API server", "LangChain QA" | sub-skills/inference-deployment/ |
| "Prepare SFT data", "validate instruction JSON", "pretrain Chinese LLaMA", "fine-tune Alpaca LoRA", "DeepSpeed/PEFT args" | sub-skills/training-finetuning/ |
| "Run C-Eval", "validate C-Eval data", "interpret examples scores", "compare q4/q8/Plus/Pro" | sub-skills/evaluation-benchmarks/ |
Minimal Public Environment Check
The original requirements.txt pins:
torch==1.13.1
transformers==4.30.0
sentencepiece==0.1.97
PEFT from the repository's pinned Hugging Face commit
Additional workflows need optional packages such as datasets, pandas, scikit-learn, fastapi, uvicorn, shortuuid, gradio, langchain, FAISS, or DeepSpeed. Install only the optional group required by the selected workflow.
Safe check from the generated skill root:
python scripts/check_environment.py --include-optional
Use python scripts/verify_sha256.py /path/to/file --expected name=hex from the same skill root when validating downloaded model, tokenizer, or data files. These helpers only import packages, check CUDA visibility, or hash files; they do not download models, launch servers, run training, or read credentials.
Common Boundaries
- If a user only has LoRA files and wants generation, reconstruct or load the LoRA with a compatible base model first.
- If a user wants chat/instruction following, prefer Chinese Alpaca and use the Alpaca prompt template. Chinese LLaMA is base/continuation-oriented.
- If a user wants training, validate data before allocating GPUs. Real training is long-running.
- If a user wants benchmark claims, record model path, dataset, decoding flags, hardware, and skipped/failed cases; do not infer global quality from example tables.
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).