1git clone https://github.com/Tianyu-Zhou1964/PIE-Handmaking_LLM.git
2cd PIE-Handmaking_LLM
1# 按你的 CUDA 版本选(推理也可以用 CPU,跳过 --index-url 直接 pip install torch)
2pip install torch --index-url https://download.pytorch.org/whl/cu121 # CUDA 12.1
3
4pip install -r requirements.txt
1curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2source $HOME/.cargo/env
1winget install Rustlang.Rustup
2# 或者去 https://rustup.rs 下载 rustup-init.exe 双击安装
1pip install maturin
2
3cd Chinese/src/custom_bpe/
4maturin develop --release
5cd ../../..
1# 方式一:huggingface-hub(推荐,自动断点续传)
2pip install huggingface_hub
3python -c "
4from huggingface_hub import hf_hub_download
5hf_hub_download(
6 repo_id='Tianyu-Zhou/PIE1.0-0.2B-dense-base',
7 filename='PIE-0.2B-dense.pth',
8 local_dir='./Checkpoint'
9)
10"
11
12# 方式二:git lfs(需要提前安装 git-lfs)
13git lfs install
14git clone https://huggingface.co/Tianyu-Zhou/PIE1.0-0.2B-dense-base ./hf_model
15cp hf_model/PIE-0.2B-dense.pth Checkpoint/
16
17# 国内用户:从 ModelScope 下载
18pip install modelscope
19python -c "
20from modelscope.hub.snapshot_download import snapshot_download
21snapshot_download('Zaoshangzhou/PIE1.0-0.2B-dense-base', cache_dir='./Checkpoint')
22"
1ls Checkpoint/
2# 应该看到 PIE-0.2B-dense.pth
1cd Chinese/src/
2python inference.py