LLMFarm-MiniCPM
代码基于LLMFarm. 需要注意的是,运行在ios上的是量化后的模型,可能会有一些精度损失。
ios上部署MiniCPM说明
第一种直接下载我们转换好的模型,可以跳过后面模型转换和量化
第二种从huggingface上下载原始模型,并按下面步骤进行转换和量化。
- git clone https://github.com/OpenBMB/llama.cpp.git
- cd llama.cpp && make -j8
- python3 convert.py ${hf_model_dir} --vocab-type hfft --outtype f32
- ./quantize ${hf_model_dir}/ggml-model-f32.gguf ${output_dir}/minicpm-q4_1.gguf q4_1
- git clone https://github.com/OpenBMB/LLMFarm-MiniCPM.git
- cd LLMFarm-MiniCPM && git submodule update --init --recursive
- 用xcode打开当前目录
- 配置开发者账号
- 设备选择mac或者手机
- 编译安装

- add chat:"select model" 选择量化后的模型
- Settings template: 选择CPM
- save后开始对话


