Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.8 KB

README_cn.md

File metadata and controls

38 lines (27 loc) · 1.8 KB

LLMFarm-MiniCPM

英文版

代码基于LLMFarm. 需要注意的是,运行在ios上的是量化后的模型,可能会有一些精度损失。

ios上部署MiniCPM说明

第一种直接下载我们转换好的模型,可以跳过后面模型转换和量化

第二种从huggingface上下载原始模型,并按下面步骤进行转换和量化。

下载hf模型

模型格式转换和量化

  1. git clone https://github.com/OpenBMB/llama.cpp.git
  2. cd llama.cpp && make -j8
  3. python3 convert.py ${hf_model_dir} --vocab-type hfft --outtype f32
  4. ./quantize ${hf_model_dir}/ggml-model-f32.gguf ${output_dir}/minicpm-q4_1.gguf q4_1

编译安装

  1. git clone https://github.com/OpenBMB/LLMFarm-MiniCPM.git
  2. cd LLMFarm-MiniCPM && git submodule update --init --recursive
  3. 用xcode打开当前目录
  4. 配置开发者账号
  5. 设备选择mac或者手机
  6. 编译安装
image

开始对话

  1. add chat:"select model" 选择量化后的模型
  2. Settings template: 选择CPM
  3. save后开始对话
image image image