ollama实战(一) :部署自己的模型(Safetensors格式)

ollama实战(一) :部署自己的模型(Safetensors格式)

1.ollama下载操作

git clone https://www.modelscope.cn/modelscope/ollama-linux.git
cd ollama-linux
sudo chmod 777 ./ollama-modelscope-install.sh
./ollama-modelscope-install.sh

1.1说明

对于llama-chinese-8b进行ollama环境创建 Safetensors格式(这个格式推理比较慢)

对Safetensors weights支持的格式:

- Llama (including Llama 2, Llama 3, and Llama 3.1);
- Mistral (including Mistral 1, Mistral 2, and Mixtral);
- Gemma (including Gemma 1 and Gemma 2); and
- Phi3

注:8b创建环境内存所需空间大约要60g,不支持格式的模型须llamacpp转gguf格式

1.2模型下载

git clone https://www.modelscope.cn/FlagAlpha/Llama3-Chinese-8B-Instruct.git

2.ollama启动

ollama serve

3.创建file文件(非文件夹)

文件内容(即你的模型路径)

FROM ./Llama3-Chinese-8B-Instruct

4.ollama模型创建

file 及你创建的文件名

ollama create mymodel -f file

注:8b模型(safetensors)创建过程约会消耗60g内存

5.ollama运行

ollama run mymodel

注:大约占16个g显存,gguf格式约占6个g

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值