在阿里云上快速跑起来自己本地部署的类chatgpt(llama.cpp)

发现AI实在是太火了,看到这个llama有泄露的版本。


想玩一下



在阿里云上租了一个普通服务器玩起来了。实测8C32G的大概200G硬盘的主机就能跑(实际我觉得应该可以更小)

实测开通Ubuntu 22版本非常方便。

CentOS 7.9bug很多,不再建议用了



部署步骤如下:

  1. 下载模型。我下载了7B模型脚本

curl -O https://raw.githubusercontent.com/shawwn/llama-dl/56f50b96072f42fb2520b1ad5a1d6ef30351f23c/llama.sh

  1. 脚本中修改如下的行

MODEL_SIZE="7B,13B,30B,65B"

为:MODEL_SIZE="7B"

  1. 执行下载文件

bash llama.sh


  1. 编译和运行llama.cpp

部署步骤如下:


# build this repo
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make

# obtain the original LLaMA model weights and place them in ./models
ls ./models
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model

# install Python dependencies
python3 -m pip install torch numpy sentencepiece

# convert the 7B model to ggml FP16 format
python3 convert-pth-to-ggml.py models/7B/ 1

# quantize the model to 4-bits
./quantize.sh 7B

# run the inference
./main -m ./models/7B/ggml-model-q4_0.bin -t 8 -n 128


然后就可以跑起来了


暂时还不支持中文(我考虑后续买个阿里云的机器翻译,中英文翻译一下玩)。感觉llama还是很不靠谱

展开阅读全文

页面更新:2024-03-14

标签:阿里   机器翻译   中英文   中文   脚本   模型   步骤   硬盘   主机   版本

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top