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.md when checking freshness against a repository checkout.
- Read
references/model-family-overview.md to choose Chinese LLaMA versus Chinese Alpaca, size, Plus/Pro, and tokenizer family.
- Read
references/environment-and-installation.md before creating an environment or installing optional dependencies.
- Run
scripts/check_environment.py for a safe dependency/backend probe.
- Use
scripts/verify_sha256.py with the checksum reference when checking downloaded model/tokenizer assets.
- Use
references/troubleshooting.md for cross-cutting install/import/asset/backend failures.
- Use
references/compliance-and-limitations.md before 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.
1---2name: chinese-llama-alpaca3description: "Route Chinese-LLaMA-Alpaca model reconstruction,4 inference/deployment, training/fine-tuning, and evaluation workflows."5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/vectorspacelab/chinese-llama-alpaca8 disco-role: operating9license: Apache 2.010---1112# Chinese-LLaMA-Alpaca Repo Skill1314Use 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.1516This 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.1718## Start Here19201. Read [`references/repo-provenance.md`](references/repo-provenance.md) when checking freshness against a repository checkout.212. Read [`references/model-family-overview.md`](references/model-family-overview.md) to choose Chinese LLaMA versus Chinese Alpaca, size, Plus/Pro, and tokenizer family.223. Read [`references/environment-and-installation.md`](references/environment-and-installation.md) before creating an environment or installing optional dependencies.234. Run [`scripts/check_environment.py`](scripts/check_environment.py) for a safe dependency/backend probe.245. Use [`scripts/verify_sha256.py`](scripts/verify_sha256.py) with the checksum reference when checking downloaded model/tokenizer assets.256. Use [`references/troubleshooting.md`](references/troubleshooting.md) for cross-cutting install/import/asset/backend failures.267. Use [`references/compliance-and-limitations.md`](references/compliance-and-limitations.md) before publishing outputs or advising on commercial/safety-sensitive use.2728## Route Map2930| User request | Use |31| --- | --- |32| "Merge Chinese Alpaca LoRA with LLaMA", "convert to HF/PTH", "tokenizer mismatch", "verify adapter checksum" | [`sub-skills/model-reconstruction/`](sub-skills/model-reconstruction/) |33| "Run inference", "batch predictions", "interactive single-turn", "Gradio demo", "OpenAI API server", "LangChain QA" | [`sub-skills/inference-deployment/`](sub-skills/inference-deployment/) |34| "Prepare SFT data", "validate instruction JSON", "pretrain Chinese LLaMA", "fine-tune Alpaca LoRA", "DeepSpeed/PEFT args" | [`sub-skills/training-finetuning/`](sub-skills/training-finetuning/) |35| "Run C-Eval", "validate C-Eval data", "interpret examples scores", "compare q4/q8/Plus/Pro" | [`sub-skills/evaluation-benchmarks/`](sub-skills/evaluation-benchmarks/) |3637## Minimal Public Environment Check3839The original `requirements.txt` pins:4041```text42torch==1.13.143transformers==4.30.044sentencepiece==0.1.9745PEFT from the repository's pinned Hugging Face commit46```4748Additional 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.4950Safe check from the generated skill root:5152```bash53python scripts/check_environment.py --include-optional54```5556Use `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.5758## Common Boundaries5960- If a user only has LoRA files and wants generation, reconstruct or load the LoRA with a compatible base model first.61- If a user wants chat/instruction following, prefer Chinese Alpaca and use the Alpaca prompt template. Chinese LLaMA is base/continuation-oriented.62- If a user wants training, validate data before allocating GPUs. Real training is long-running.63- 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.