🚀 ngxson/gemma-3-4b-pt-Q4_0-GGUF
本项目将模型从 google/gemma-3-4b-pt
转换为 GGUF 格式。转换借助 llama.cpp,通过 ggml.ai 的 GGUF-my-repo 空间完成。如需了解该模型的更多详细信息,请参考 原始模型卡片。
🚀 快速开始
本模型可通过 llama.cpp 进行使用,以下为具体步骤。
📦 安装指南
可通过 brew(适用于 Mac 和 Linux)安装 llama.cpp:
brew install llama.cpp
💻 使用示例
基础用法
可通过 CLI 或 Server 调用该模型。
CLI 调用
llama-cli --hf-repo ngxson/gemma-3-4b-pt-Q4_0-GGUF --hf-file gemma-3-4b-pt-q4_0.gguf -p "The meaning to life and the universe is"
Server 调用
llama-server --hf-repo ngxson/gemma-3-4b-pt-Q4_0-GGUF --hf-file gemma-3-4b-pt-q4_0.gguf -c 2048
高级用法
你也可以直接按照 Llama.cpp 仓库中列出的 使用步骤 使用该检查点,具体步骤如下:
步骤 1:从 GitHub 克隆 llama.cpp
git clone https://github.com/ggerganov/llama.cpp
步骤 2:进入 llama.cpp 文件夹并使用 LLAMA_CURL=1
标志以及其他特定硬件标志(例如,在 Linux 上使用英伟达 GPU 时使用 LLAMA_CUDA=1
)进行编译
cd llama.cpp && LLAMA_CURL=1 make
步骤 3:通过主二进制文件运行推理
./llama-cli --hf-repo ngxson/gemma-3-4b-pt-Q4_0-GGUF --hf-file gemma-3-4b-pt-q4_0.gguf -p "The meaning to life and the universe is"
或者
./llama-server --hf-repo ngxson/gemma-3-4b-pt-Q4_0-GGUF --hf-file gemma-3-4b-pt-q4_0.gguf -c 2048
📄 许可证
本项目使用的许可证为 gemma 许可证。
属性 |
详情 |
基础模型 |
google/gemma-3-4b-pt |
库名称 |
transformers |
许可证 |
gemma |
任务类型 |
图像文本到文本 |
标签 |
llama-cpp, gguf-my-repo |
⚠️ 重要提示
要在 Hugging Face 上使用 Gemma,你需要查看并同意 Google 的使用许可。为此,请确保你已登录 Hugging Face 并点击下方按钮。请求将立即处理。
💡 使用建议
可根据自身硬件情况,在编译 llama.cpp 时添加特定硬件标志,如在 Linux 上使用英伟达 GPU 时添加 LLAMA_CUDA=1
以加速推理。