2023年5月2日星期二

如何使用llama

 模型下载

安装git lfs

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

apt-get install git-lfs

git lfs install

git clone https://huggingface.co/THUDM/chatglm-6b

这样就下载完成了。


如果是llama.app

https://github.com/ggerganov/llama.cpp

下载程序

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
  • On Windows:

    1. Download the latest fortran version of w64devkit.
    2. Extract w64devkit on your pc.
    3. Run w64devkit.exe.
    4. Use the cd command to reach the llama.cpp folder.
    5. From here you can run:
      make
在https://huggingface.cohttps://huggingface.co搜索到模型并下载完成后,转换成4int版本
python3 convert.py models/7B/
上面命令转换成ggml-model-f16.bin文件
然后
./quantize ./models/7B/ggml-model-f16.bin ./models/7B/ggml-model-q4_0.bin q4_0
转换成gml-model-q4_0.bin文件
运行下面命令就可以运行了:
./main -m ./models/7B/ggml-model-q4_0.bin -n 128

没有评论:

发表评论

小型网站的ubuntu服务器如何提升连接数

 当服务器有多个api应用,或者网站的时候,会出现网页打不开。但是cpu、内存等都很空闲。这种情况,有可能是网站的文件数设置不正确。 查询服务器支持的TCP连接数: ulimit -n 默认是1024 需要增加方法: 编辑/etc/security/limits.conf * s...