原文:个人主页原文
下载
克隆Llama的官方Github仓库:
git clone https://github.com/facebookresearch/llama.git
进入llama文件夹,运行命令:
python -m pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
# -i 后的参数为临时换源
这会自动执行当前目录下的setup.py文件,以安装当前项目
到Llama官网进行申请,据说填写邮箱后会收到邮件,但一直没收到。所以到huggingface下载第三方下载好的权重:https://huggingface.co/NousResearch/Llama-2-7b-hf(这个已经是huggingface格式的了)
运行
光是下载就花了四五天,更新一下运行记录。使用中文模型Chinese-LLaMA-Alpaca的scripts/inference/inference_hf.py脚本来运行一下模型(注意安装好依赖包,如果出错可能是依赖包的版本不符合requirements.txt的问题)
运行命令:
python /home/jc/workspace/exp/test_llama.py \
--base_model /home/jc/workspace/llama/Llama-2-7b-hf \
--with_prompt \
--interactive
其中--base_model为在下载阶段,下载下来的文件夹的路径。
运行结果如下:

初步的运行完成,就是简单备忘一下运行过程~

被折叠的 条评论
为什么被折叠?



