参考:
https://github.com/TabbyML/tabby
微软商店,搜索winget,安装App Installer
PS C:\Windows\system32> winget install --id Git.Git -e --source winget
Found Git [Git.Git] Version 2.41.0.2
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.2/Git-2.41.0.2-64-bit.exe
0.00 B / 58.3 MB
或者直接下载git.exe图像化安装
Git - Downloads (git-scm.com)
git clone https://github.com/TabbyML/tabby.git
控制面板,程序
打开Windows功能,勾选上Hyper-V和虚拟机平台
wsl(Windows Subsystem for Linux)更新
管理员权限打开Windows Power Shell
执行命令查看相关子系统
PS C:\Windows\system32> wsl --list --online
The following is a list of valid distributions that can be installed.
The default distribution is denoted by '*'.
Install using 'wsl --install -d '.
NAME FRIENDLY NAME
* Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
openSUSE-42 openSUSE Leap 42
SLES-12 SUSE Linux Enterprise Server v12
Ubuntu-16.04 Ubuntu 16.04 LTS
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
不指定参数默认安装第一个星号标记的Ubuntu
> wsl --install
输出:
PS C:\Windows\system32> wsl --install
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Downloading: WSL Kernel
Installing: WSL Kernel
WSL Kernel has been installed.
Downloading: Ubuntu
The requested operation is successful. Changes will not be effective until the system is rebooted.
重启电脑
Docker: Accelerated, Containerized Application Development
Docker | Tabby
本文选择了CPU,打开PowerShell,在clone下来的tabby根目录下,执行下面的命令
docker run -p 8080:8080 -v $HOME/.tabby:/data tabbyml/tabby serve --model TabbyML/SantaCoder-1B
输出
如果遇到如下问题
ERROR tabby::serve: crates/tabby/src/serve/mod.rs:116: Failed to fetch model due to 'error sending request for url (https://huggingface.co/TabbyML/SantaCoder-1B/resolve/main/ctranslate2/shared_vocabulary.txt): error trying to connect: Connection reset by peer (os error 104)', is 'TabbyML/SantaCoder-1B' a valid model id?
解决方法
手动下载模型
TabbyML/SantaCoder-1B at main
git lfs install
git clone https://huggingface.co/TabbyML/SantaCoder-1B
大文件也可以直接网页手动下载
最后将上述SantaCoder完整目录文件移动到
$HOME/.tabby/models/TabbyML/目录下
然后再重新执行
docker run -p 8080:8080 -v $HOME/.tabby:/data tabbyml/tabby serve --model TabbyML/SantaCoder-1B
部署过程中需要等待,没有log可以显示进度,可以通过查看容器Container的stats的网络流量蓝色的数据接收一直在增长,表示部署中
(时间取决设备性能)
2023-07-19 08:36:57 2023-07-19T08:36:56.481802Z INFO tabby::serve: crates/tabby/src/serve/mod.rs:131: Listening at 0.0.0.0:8080
检查是否部署成功
浏览器本地访问 http://localhost:8080/
或者在网络中使用 http://PC_IP:8080/
下载并安装VS Code(Visual Studio Code)
direct download link.Download Visual Studio Code - Mac, Linux, Windowsdirect download link.
打开VS Code,扩展种搜索Tabby并安装
Tabby的管理里面设置上面本地部署的Tabby服务
输入注释或者编码时,会自动补全,即灰色斜体部分,如果接收就直接按Tab键,采纳建议,否则正常进行编码