【自然语言处理与大模型】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

相关推荐
Jamence9 分钟前
多模态大语言模型arxiv论文略读(111)
论文阅读·人工智能·语言模型·自然语言处理·论文笔记
火车叼位11 分钟前
使用 uv 工具在 Windows 系统快速下载安装与切换 Python
python
归去_来兮13 分钟前
图神经网络(GNN)模型的基本原理
大数据·人工智能·深度学习·图神经网络·gnn
爱吃饼干的熊猫17 分钟前
PlayDiffusion上线:AI语音编辑进入“无痕时代”
人工智能·语音识别
SelectDB技术团队26 分钟前
Apache Doris + MCP:Agent 时代的实时数据分析底座
人工智能·数据挖掘·数据分析·apache·mcp
Leinwin26 分钟前
微软推出SQL Server 2025技术预览版,深化人工智能应用集成
人工智能·microsoft
心扬34 分钟前
python网络编程
开发语言·网络·python·tcp/ip
忧陌60637 分钟前
DAY 44 预训练模型
python
CareyWYR1 小时前
每周AI论文速递(2506202-250606)
人工智能
点云SLAM1 小时前
PyTorch 中contiguous函数使用详解和代码演示
人工智能·pytorch·python·3d深度学习·contiguous函数·张量内存布局优化·张量操作