【自然语言处理与大模型】Ollama拉取huggingface社区或modelscope社区的GGUF模型并部署

huggingface社区和魔塔社区上的gguf模型现在都支持了ollama部署模型。本文做一个简单的使用总结,详细的官方文档我放在文末。

一、快速使用命令

(1)huggingface

ollama拉取并部署gguf模型命令

bash 复制代码
# hf.co是huggingface社区
# username/repository是模型在社区的路径
ollama run hf.co/{username}/{repository}

国内用户可以将hf.co改成hf-mirror.com

bash 复制代码
ollama run hf-mirror.com/{username}/{repository}

拉取带量化的gguf模型

bash 复制代码
# 命令
ollama run hf.co/{username}/{repository}:{quantization}
# 以千问模型为例
ollama run hf.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF:Q2_K

实际跑一下命令,发现huggingface社区拉取GGUF模型巨慢无比!

(2)modelscope

首推国内的魔塔社区,下载快的多!进入社区的模型库,找到要下载的模型。

点击"下载模型"后,再点击"操作指引"。

在左侧导航栏中找到Ollama加载ModelScope模型,就能看到命令。

二、官方说明文档

Ollama如何在HuggingFaceHub里使用任何GGUF模型https://huggingface.co/docs/hub/en/ollama#use-ollama-with-any-gguf-model-on-hugging-face-hubOllama加载ModelScope模型https://www.modelscope.cn/docs/models/advanced-usage/ollama-integration

相关推荐
少吃零食多运动17 小时前
【Jupyter notebook修改工作目录】
python·jupyter
慎独41318 小时前
家家有平台:Web3.0绿色积分引领消费新纪元
大数据·人工智能·物联网
Swizard18 小时前
别买树莓派了!3步教你在安卓手机上跑通 CPython + PaddleOCR,打造随身 AI 识别终端
python·ai·移动开发
火云牌神18 小时前
如何选择FAISS的索引类型
人工智能·faiss
Gavin在路上18 小时前
SpringAIAlibaba之高级特性与实战场景全解析(5)
人工智能
会挠头但不秃18 小时前
深度学习(4)卷积神经网络
人工智能·神经网络·cnn
百***243718 小时前
GPT-5.2 技术升级与极速接入指南:从版本迭代到落地实践
大数据·人工智能·gpt
weixin_4215850119 小时前
PYTHON 迭代器1 - PEP-255
开发语言·python
L.fountain19 小时前
图像自回归生成(Auto-regressive image generation)实战学习(一)
人工智能·深度学习·学习·计算机视觉·图像自回归