Tabby 一:如何在Mac配置保姆级教程(本地模型替换hugging face下载)

1. brew安装

mac需要先安装brew,如果本地已经安装过brew这一步可以忽略,遇到问题可以自己ai问

bash 复制代码
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

可能遇到source .zprofile失败,因为默认文件不可见,需要在文件夹下让文件可见,权限问题chmod解决。

2. tabby安装

bash 复制代码
brew install tabbyml/tabby/tabby

3. 启动服务

官方给的命令如下:无法科学上网的话,这条命令大概率会失败

bash 复制代码
tabby serve --device metal --model StarCoder-1B --chat-model Qwen2-1.5B-Instruct

错误1:

bash 复制代码
 Library not loaded: /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: <E16908F1-ECA2-3D1D-8113-B7760B8E3425> /opt/homebrew/Cellar/tabby/0.26.0/bin/tabby
  Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file)

解决方法:安装openssl@3

bash 复制代码
 brew install openssl@3

ln -s /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib /usr/local/lib/

错误2:

bash 复制代码
Writing to new file.
File exists. Resuming.
File exists. Resuming.
The application panicked (crashed).
Message:  Failed to fetch model 'StarCoder-1B' due to 'Fetching 'https://huggingface.co/TabbyML/models/resolve/main/starcoderbase-1B.Q8_0.gguf' failed: Server returned error sending request for url (https://huggingface.co/TabbyML/models/resolve/main/starcoderbase-1B.Q8_0.gguf) HTTP status'
Location: /Users/runner/work/tabby/tabby/crates/tabby-download/src/lib.rs:210

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

解决办法:

这个是最难解决的,如果实在无法科学上网,这种方法可以替代

从这个魔塔社区找自己想要使用的模型(前提是自己的电脑能跑的起来),选择适合自己的配置的模型,查找对应的gguf后缀的模型

下载下来之后重命名为这种格式model-00001-of-00001.gguf(一定要重命名,有具体含义的,可以找AI问下,跟切片相关的),然后放到以下目录:/<your tabby目录>/TabbyML/<tabby.json中命名的模型名一致>/ggml/model-00001-of-00001.gguf

比如我下载下来的是deepseek-coder-6.7b-base.Q4_K_M.gguf,我的ggml的上一层目录命名为DeepseekCoder-6.7B,然后修改tabby.json中的name与之对应。

我还下载了一个模型:qwen2.5-3b-instruct-q4_k_m.gguf作为chat-model,配置如下

差点忘了,还有一个关键的:embed-text模型也要下载下来 ,gguf文件同样修改命名方式放到ggml目录即可(一般直接搜索名称有可能很难找到gguf的文件,后面加上-gguf搜索,比如Nomic-Embed-Text-gguf,可以直接找到这样的文件,记得是切换到模型文件才能看到哈)

启动参数需要修改的几个点:

  1. --model参数,改成本地目录到TabbyML的下一级目录,比如:DeepseekCoder-6.7B

  2. --chat-model参数,改成本地目录到TabbyML的下一级目录,比如:qwen2.5-3b-instruct

  3. tabby.json文件修改

参考:

复制代码
{
    "prompt_template": "<PRE>{prefix}<SUF>{suffix}<MID>",
    "chat_template":  "<s>{% for message in messages %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + '</s> ' }}{% endif %}{% endfor %}",
}

启动命令如下:

bash 复制代码
tabby serve --device metal --model /Users/xxx/.tabby/models/TabbyML/DeepseekCoder-6.7B --chat-model /Users/xx/.tabby/models/TabbyML/qwen2.5-3b-instruct

终于启动成功了,具体使用我后续再写一个,据说可以把自己的代码离线运用起来

相关推荐
zeroporn8 小时前
在Mac M1/M2上使用Hugging Face Transformers进行中文文本分类(完整指南)
macos·分类·数据挖掘·nlp·transformer·预训练模型·文本分类
FreeBuf_9 小时前
CVE-2025-31258 macOS远程视图服务沙箱逃逸漏洞PoC已公开
macos
小宋加油啊9 小时前
Mac QT水平布局和垂直布局
开发语言·qt·macos
fanstering9 小时前
mac一键安装gpt-sovit教程中,homebrew卡住不动的问题
gpt·macos
上天_去_做颗惺星 EVE_BLUE10 小时前
Docker入门教程:常用命令与基础概念
linux·运维·macos·docker·容器·bash
深井冰水17 小时前
mac M2能安装的虚拟机和linux系统系统
linux·macos
这是一个懒人19 小时前
mac 快速安装stable diffusion webui
macos·stable diffusion
Eloudy1 天前
MacOS 上构建 gem5
linux·运维·macos
全栈技术负责人1 天前
cursor对话关键词技巧
ai编程
深井冰水1 天前
mac M2下虚拟机CentOS 8 安装上安装 Berkeley DB
数据库·macos·centos