1 申请Llama2 许可
地址似乎不能填中国

1.1 获取url
提交申请后,填的那个邮箱会受到一封meta发来的邮件,打码部分的url,之后会用得上

2 ubuntu/linux 端部署Llama2
2.1 git clone Llama2的github 仓库
bash git clone https://github.com/facebookresearch/llama.git
2.2 安装Llama2运行所需要的依赖
bash
pip install -e .
2.3 下载模型权重
bash
bash download.sh
- 随后命令行要求验证URL,将刚刚邮件中的打码的那一部分复制进去。
- 然后输入你要下载的模型【如果下载多个,逗号分隔】
3 测试demo
python
torchrun --nproc_per_node 1 example_chat_completion.py --ckpt_dir llama-2-7b-chat/ --tokenizer_path tokenizer.model --max_seq_len 512 --max_batch_size 6 >1.txt 2>&1
